To be honest, I thought if you databound the grid, it would automatically page for you if you had allowpaging = true.
But evidentally you have to handle the PageIndexChanging event.
But what would I put in there?
Thanks,
Justin Fox
Printable View
To be honest, I thought if you databound the grid, it would automatically page for you if you had allowpaging = true.
But evidentally you have to handle the PageIndexChanging event.
But what would I put in there?
Thanks,
Justin Fox
If you have bound the gridview (I assumed you meant Gridview instead of DataGrid) to a DataSourceControl then you don't need to do anything special for paging to happen. but if you bind it to a datatable then you have to do additional processing.
What is it that you are trying to achieve and what are the specific issues you are facing?
Set the page's index property to the new page number. Rebind it.
ok, so if you just do grid.pageindex = e.newpageindex and then
just rebind the grid, the grid will know what new items to show on the
next page?
Actually, I put 'grid.pageindex = e.newpageindex, but the little paging links are all jacked up. Like if I click on link '2' nothing happens, but if i click on '3' then it will move to '2'.
I might just try the DataSourceControl thingy.
Thanks for the help,
Justin Fox
As mentioned by mendhak, call grid.DataBind again, after the grid.pageindex = e.newpageindex statement (if you are not using a datasource control).
I forgot about the whole rebind thing, get off track sometimes.
I'll post tonight whether I was successfull or not.
Thanks Again!
Justin