Microsoft .NET - Tips and Tricks
Saturday, January 05, 2008
Custom paging SPGridView control
Why new grid?
I needed a paged grid control on one of the projects I was involved in recently. It was a MOSS 2007 project, I wanted the grid to look similar to MOSS 2007 grids so my first choice was SPGridView control. When I tried the control I saw its built-in paging functionality is not suitable for my needs because SPGridView expects the whole result set and then it does the paging automatically. Because of very large result set that my grid should show in MOSS that was not a solution for me.
Therefore I started looking for a solution that will allow me a kind of custom paging where only results that should be shown on a current page are retrieved from data store and assigned to grid control.
I couldn't find one but I remembered that I read once about a similar grid control for ASP.NET published on CodeProject by Fadrian Sudaman (http://www.codeproject.com/KB/aspnet/GridViewNeatPaging.aspx). I used similar idea, created my own control that inherits from SPGridView and decided to share that with Microsoft community. I created a project on CodePlex and published my code there: http://www.codeplex.com/aspnetlibrary
I also created a sample project that demonstrates the usage of my grid control. The project consists of a sample web part, some SQL to generate sample database with a stored procedure that retrieves paged data and configuration files to allow automated deployment of sample web part to MOSS 2007.
posted by Popovic Sasa
Links to this post:
+ Blog Home
Get the Levi9 RSS Feed
Levi9 Global Sourcing
+ Serving files from server
+ Configuring CruiseControl .Net to work with multip...
+ Sharing cookies between sub-domains
+ February 2007
+ March 2007
+ April 2007
+ January 2008
+ February 2008