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

G

Guoqi zheng

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
 
K

Ken Cox [Microsoft MVP]

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]
 
G

Guoqi zheng

Super.

Thank you very much.

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

Ken Cox said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top