By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,948 Members | 1,857 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,948 IT Pros & Developers. It's quick & easy.

Default paging, how to show text "page nr.:"

P: n/a
Dear sir,

I am using the default paging function of datagrid. Below is my code.

<PagerStyle NextPageText="&gt;&gt;&gt;" PrevPageText="&lt;&lt;&lt;"
HorizontalAlign="Center" Mode="NumericPages"></PagerStyle>

It works fine, it show a 1 2 3 4 5 page nr. at the bottom of datagrid.

However, what I want is that before 1 2 3 4 5, I would like to show a text
saying "page nr.:" So it should be:

........
Page nr.: 1 2 3 4 5

I think it will be clearer for peope to know that it is a page nr.

How should I achieve this????

Thanks.

Guoqi Zheng
http://www.meetholland.com
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Guoqi,

Try this?

Private Sub DataGrid1_ItemCreated _
(ByVal sender As Object, ByVal e As _
DataGridItemEventArgs) Handles DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Pager Then
Dim pagerCell As TableCell
pagerCell = CType(e.Item.Controls(0), TableCell)
Dim pageOf As String = _
"Page nr.: "
pagerCell.Controls.AddAt(0, _
New LiteralControl(pageOf))
End If
End Sub

Ken
Microsoft MVP [ASP.NET]

"Guoqi zheng" <no@sorry.nl> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
Dear sir,

I am using the default paging function of datagrid. Below is my code.

<PagerStyle NextPageText="&gt;&gt;&gt;" PrevPageText="&lt;&lt;&lt;"
HorizontalAlign="Center" Mode="NumericPages"></PagerStyle>

It works fine, it show a 1 2 3 4 5 page nr. at the bottom of datagrid.

However, what I want is that before 1 2 3 4 5, I would like to show a text
saying "page nr.:" So it should be:

.......
Page nr.: 1 2 3 4 5

I think it will be clearer for peope to know that it is a page nr.

How should I achieve this????

Thanks.

Guoqi Zheng
http://www.meetholland.com


Nov 18 '05 #2

P: n/a
Super.

Thank you very much.

Gr.
Guoqi Zheng
http://www.meetholland.com

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:eq**************@TK2MSFTNGP10.phx.gbl...
Hi Guoqi,

Try this?

Private Sub DataGrid1_ItemCreated _
(ByVal sender As Object, ByVal e As _
DataGridItemEventArgs) Handles DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Pager Then
Dim pagerCell As TableCell
pagerCell = CType(e.Item.Controls(0), TableCell)
Dim pageOf As String = _
"Page nr.: "
pagerCell.Controls.AddAt(0, _
New LiteralControl(pageOf))
End If
End Sub

Ken
Microsoft MVP [ASP.NET]

"Guoqi zheng" <no@sorry.nl> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
Dear sir,

I am using the default paging function of datagrid. Below is my code.

<PagerStyle NextPageText="&gt;&gt;&gt;" PrevPageText="&lt;&lt;&lt;"
HorizontalAlign="Center" Mode="NumericPages"></PagerStyle>

It works fine, it show a 1 2 3 4 5 page nr. at the bottom of datagrid.

However, what I want is that before 1 2 3 4 5, I would like to show a text saying "page nr.:" So it should be:

.......
Page nr.: 1 2 3 4 5

I think it will be clearer for peope to know that it is a page nr.

How should I achieve this????

Thanks.

Guoqi Zheng
http://www.meetholland.com

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.