-
Feb 27th, 2009, 09:07 AM
#1
Thread Starter
Frenzied Member
[2005] DataGrid Paging help...
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
-
Feb 27th, 2009, 01:04 PM
#2
Fanatic Member
Re: [2005] DataGrid Paging help...
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?
-
Feb 27th, 2009, 03:20 PM
#3
Re: [2005] DataGrid Paging help...
Set the page's index property to the new page number. Rebind it.
-
Feb 28th, 2009, 11:50 AM
#4
Thread Starter
Frenzied Member
Re: [2005] DataGrid Paging help...
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
-
Feb 28th, 2009, 11:54 AM
#5
Re: [2005] DataGrid Paging help...
As mentioned by mendhak, call grid.DataBind again, after the grid.pageindex = e.newpageindex statement (if you are not using a datasource control).
-
Feb 28th, 2009, 11:57 AM
#6
Thread Starter
Frenzied Member
Re: [2005] DataGrid Paging help...
I forgot about the whole rebind thing, get off track sometimes.
I'll post tonight whether I was successfull or not.
Thanks Again!
Justin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|