how to enable paging on data grid

  • Thread starter Thread starter Joe Au
  • Start date Start date
J

Joe Au

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 said:
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".
 
Back
Top