SharePointCommunity
Die deutschsprachige Community für SharePoint, Microsoft 365, Teams, Yammer und mit Azure
SharePoint - Guide to using a SPGridView

Blogs

Oliver Wirkus

Syndication

Certifications

Web 2.0

http://smits-net.de/img/linkedin_button.gif

XING

http://i80.photobucket.com/albums/j191/mikesamerica/twitter_button_zpsee74f711.png

 

 Add to Technorati Favorites

 

 Delicious Bookmark this on Delicious

 

  Locations of visitors to this page

 

The SPGridView control id often used to display data, but handling with its various properties can be confusing. As long as it is only used to simply display some data, setting up this control is far beyond any rocket science. But when filtering and sorting on various columns should be used, the handling of the properties, the event handlers and the view states can be very tricky. That’s the reason why there are guidance posts in so many blogs.

I found a very handy guide to setup a SPGridView control with sorting and filtering in the Reverse Alchemy blog. Erik Burger wrote two posts about how to setup a SPGridView with filtering and sorting.

This is the link to the first post: http://www.reversealchemy.net/2009/05/01/building-a-spgridview-control-part-1-introducing-the-spgridview/

This is the link to the second pots: http://www.reversealchemy.net/2009/05/24/building-a-spgridview-control-part-2-filtering/

Thanks to Erik for his awesome tutorial :-)

Remark: You don’t need to use an additional pager object like Erik has done in his code. You can use the standard pager of the SPGridView too. If you use the standard pager and filtering has been enabled you need to add an additional event receiver to the SPGridView like this:

image

image

This event receiver renews the filter expression setting of the datasource (ObjectDataSource) when the pager is clicked.

 

Add to Technorati Favorites Folge mir auf Twitter FourSquareLogo

Bereitgestellt 27 Feb 2013 11:51 von Oliver Wirkus
Gespeichert unter: ,