This Blog Has A New Home!

This blog has been moved to www.SoftwareRockstar.com. Articles already here will remain intact, while new content will only be added to the new location at www.SoftwareRockstar.com.

Thursday, September 14, 2006

Adding Controls To ASP.NET GridView Pager Row

ASP.NET 2.0 GridView control contains the AllowPaging property. Setting this property to a value of true enables the paging feature of the GridView and displays data split across multiple pages if the number of rows in the underlying data source is greater than the PageSize property. By default ASP.NET automatically displays numeric paging controls at the bottom of the GridView. While automatic paging is a very handy feature of GridView, if you want to display any additional paging controls than those inherently supported by automatic paging, you must resort to specifying your own PagerTemplate and write some additional code to preform the same functionality that GridView would otherwise handle for you. In certain situations, a better option, however, is to simply inject your custom control(s) into the pager generated by the GridView. The following example shows how we can inject a "View All" LinkButton into GridView's pager row that allows users to view all rows in the underlying data source at the same time:

3 comments:

Anonymous said...

Thank you very much for posting & sharing the codes. What I love about it, is...the code works! I've been looking at how I can implement this.

Anonymous said...

Thanks for this post.

One step further, what do I do, if the user wants paging back?

reply soon

Anonymous said...

Thanks for the post. You helped me a big deal!

New Articles On Software Rockstar