datagrid paging

  • Thread starter Thread starter Khan.A.Mushtaq
  • Start date Start date
K

Khan.A.Mushtaq

hi can any one help me how to make working page number, edit and delete
when we use datagrid on a web application in vb.net 2003. I have made
connection with my access data base and the lay out where it shows the
data one my web page and underneath show
Next Previous
on the side I have Edit Delete hyperlinks but I dont know what code I
should put to make them function
 
Khan,

First thing is to make sure that the datasource for datagrid is
DataSet/Custom Collections. Bcoz, the datasource implementing ICollection
interface will help us
to enable the Pagination mechanism in better way

Make sure the following steps for pagination
1. Set the AllowPaging property of DataGrid to True
2. Set the PageSize of the datagrid to the limit you want
3. Define the Event Handler for PageIndexChanged of the DataGrid
4. On the PageChanged Event set the CurrentPageIndex to the NewPageIndex and
do the databdind again like the following ......
Sub dGridTitles_Paging(sender As Object, e As DataGridPageChangedEventArgs)
dGridTitles.CurrentPageIndex = e.NewPageIndex
BindData()
End Sub

Pls let me know whether this is useful or you need more information
 
Back
Top