Hi,
Here's a sample that shows how to insert any text you want into the paging
area.
Let us know if it helps?
Ken
Microsoft MVP [ASP.NET]
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
If Not IsPostBack Then
DataGrid1.DataSource = CreateDataSource()
DataGrid1.DataBind()
End If
End Sub
Private Sub DataGrid1_ItemCreated _
(ByVal sender As Object, ByVal e As _
DataGridItemEventArgs) Handles DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Pager Then
Dim pager As TableCell
Dim lblMyText As New Label
lblMyText.Text = "Extra text goes here "
pager = CType(e.Item.Controls(0), TableCell)
pager.Controls.AddAt(0, lblMyText)
End If
End Sub
Function CreateDataSource() As ICollection
Dim dt As New DataTable
Dim dr As DataRow
dt.Columns.Add(New DataColumn _
("IntegerValue", GetType(Int32)))
dt.Columns.Add(New DataColumn _
("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn _
("PercentValue", GetType(Double)))
dt.Columns.Add _
(New DataColumn("Boolean", GetType(Boolean)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 0.23 * (i + 1)
dr(3) = True
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
Return dv
End Function 'CreateDataSource
<asp
ataGrid CssClass=gridstyle id="DataGrid1" runat="server"
ShowFooter="True" PageSize="2" AllowPaging="True">
<Columns>
<asp:BoundColumn DataField="Percentvalue" ReadOnly="True"
HeaderText="Percentvalue" DataFormatString="{0
}"></asp:BoundColumn>
</Columns>
<PagerStyle Position="TopAndBottom" PageButtonCount="2"
Mode="NumericPages"></PagerStyle>
</asp
ataGrid>
jmhmaine said:
How do Insert the word "Page:" in front of the auto-generated numbers in
paging?
For example, the bottom of the Datagrid currently just displays numbers:
1,2,3,4
I would like it to display:
Page: 1,2,3,4
Thanks.