how to enable paging on data grid

Discussion in 'ASP .Net' started by Joe Au, Aug 19, 2004.

  1. Joe Au

    Joe Au Guest

    I enable paging on a data grid. But when I click on the page number, nothing
    happen. Do I have to code something to handle it? Thanks.
    Joe Au, Aug 19, 2004
    #1
    1. Advertising

  2. Joe Au

    Jos Guest

    Joe Au wrote:
    > I enable paging on a data grid. But when I click on the page number,
    > nothing happen. Do I have to code something to handle it? Thanks.


    You need to handle the PageIndexChanged event.

    Use this code (for VB):

    Sub DataGrid1_PageIndexChanged(sender As Object, e As
    DataGridPageChangedEventArgs)
    DataGrid1.CurrentPageIndex = e.NewPageIndex
    BindData() ' bind the grid again
    End Sub

    For more information, see:
    http://aspnet.4guysfromrolla.com/articles/070903-1.2.aspx

    or search Google for "datagrid paging".

    --

    Jos
    Jos, Aug 19, 2004
    #2
    1. Advertising

  3. Joe Au

    Joe Au Guest

    Joe Au, Aug 19, 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. Andrew Banks

    Paging of a data grid

    Andrew Banks, Apr 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    982
    Reva Baum
    Apr 2, 2004
  2. Steve Taylor

    Data Grid Paging Bug?

    Steve Taylor, Sep 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    456
    Hermit Dave
    Sep 15, 2004
  3. =?Utf-8?B?YXNhZA==?=

    Data grid paging Error

    =?Utf-8?B?YXNhZA==?=, May 8, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,223
    Alvin Bruney [MVP - ASP.NET]
    May 8, 2005
  4. Alan Silver
    Replies:
    6
    Views:
    1,878
    Alan Silver
    Jul 28, 2005
  5. Patrick
    Replies:
    1
    Views:
    647
Loading...

Share This Page