you can easily use the paging with a grid view control. To use that successfully, you have to follow the following steps:
* add AllowPaging="true" attribute on your grid view control.
* You can set how many rows will be shown in a page, by default its set to 10.
* you have to implement an event of the gridview control, that's "PageIndexChanging" event. Otherwise, it won't work. You have to use like following code on that event
protected void gridViewControl1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
//Update the page index
ParticipantsList.PageIndex = e.NewPageIndex;
/*requery to database for re-binding the control. usually it can be accomplish
by calling the method that's doing the binding*/
BindParticipantListToGridView();
}
It should work fine now.
Subscribe to:
Post Comments (Atom)










0 comments:
Post a Comment