| « Dynamically Loading Controls | Runtime Method/Class Call » |
Custom Paging with DataTable
Recently, i found the need to do some custom paging. With this i found several resources that used either a DataSource or a DataView. My specific problem was related to the fact that i was in need of a known column definition but a slightly custom pager row.
So i started out developing the PagerRow as needed, and found that it was cool that you could simply attach 'CommandName="Page"' and 'CommandArgument="First"' to operate the function of moving back to the first page (go here on MSDN to get the full description).
Once i got this far, i then start playing with the Paging Events. First i created click events for each of the buttons to try to manually change the pages, that didnt work (wasted 1hr 30m), then i tried operating it through the PageIndexChanged event, that didnt work (wasted 1hr), lastly, by piecing all of the Custom Paging instructions from all of the high-level coding sites, i surmised a working page function for my need (investment 2hrs - PRICELESS
).
Considering the amount of time i spent on this and some self discovery, i felt like this would be something others might use. As well, it might fit into the GridView model you are looking for.
Notes To Use:
- I have removed the code that is company specific but put comments at the locations where they should be edited.
If you have any questions, please dont hesitate to comment for explanation or send me an email.
Custom Paging GridView - VB Source
Custom Paging GridView - Designer
Custom Paging GridView - HTML
Attachments:
Custom_Paging.aspx.designer.vb (2.4 KB)
Custom_Paging.aspx.vb (2.8 KB)
Custom_Paging.aspx (3.2 KB)