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

Discussion in 'ASP .Net' started by Guoqi zheng, Jun 13, 2004.

  1. Guoqi zheng

    Guoqi zheng Guest

    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
    Guoqi zheng, Jun 13, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
    >
    Ken Cox [Microsoft MVP], Jun 13, 2004
    #2
    1. Advertising

  3. Guoqi zheng

    Guoqi zheng Guest

    Super.

    Thank you very much.

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

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    Guoqi zheng, Jun 13, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,654
    Scott Allen
    Oct 8, 2004
  2. wh1974
    Replies:
    0
    Views:
    2,416
    wh1974
    Jan 12, 2005
  3. Red
    Replies:
    1
    Views:
    702
  4. Nathan Sokalski
    Replies:
    0
    Views:
    492
    Nathan Sokalski
    Jan 18, 2007
  5. Nathan Sokalski
    Replies:
    6
    Views:
    389
    Nathan Sokalski
    Jan 23, 2007
Loading...

Share This Page