how to enable paging on data grid

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.
 
J

Jos

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".
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top