<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx</link><description>In 'Part 1: Using SPGridview, adding menus, grouping and sorting' I looked at how to use an SPGridView from the ground up to bind to a custom DataSet. One of the features I omitted at the time was paging, and this post shows you how to add paging support</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Using SPGridView Filter properties</title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#2644305</link><pubDate>Tue, 15 May 2007 10:58:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2644305</guid><dc:creator>Powlo's SharePoint Treats</dc:creator><description>&lt;p&gt;Great news everyone \o/ - a solution to setting an SPGridView filter has been researched and documented&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#2968921</link><pubDate>Tue, 29 May 2007 16:46:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2968921</guid><dc:creator>RobertaRuane</dc:creator><description>&lt;p&gt;This has been a great post - thanks&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3026101</link><pubDate>Fri, 01 Jun 2007 18:17:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3026101</guid><dc:creator>ArjunaK</dc:creator><description>&lt;p&gt;This has been the BEST post on using SPGridView so far. &lt;/p&gt;
&lt;p&gt;Thank you Paul!&lt;/p&gt;</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3649034</link><pubDate>Sun, 01 Jul 2007 23:39:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3649034</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Got this working fine. However when I put a button on the web part to fire off the create dataset bit the first page of the results are returned fine but if I then select another page the results control disappears completely. Any ideas ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3658849</link><pubDate>Mon, 02 Jul 2007 14:56:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3658849</guid><dc:creator>Paul Robinson</dc:creator><description>&lt;p&gt;sounds like an issue with the page lifecycle - is it possible you dont initialise the control properly on the callback, or dont persist the state?&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3669153</link><pubDate>Tue, 03 Jul 2007 12:29:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3669153</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;Yes, thanks you were absolutly right.&lt;/p&gt;
&lt;p&gt;On a slightly different but related subject when the CreateChildControls has a conditional set of contols on it. ie either search criteria or search results. When these are switched I am getting an error &amp;quot;unexpected error has occurred&amp;quot;. I have found that whenever I add contols to the web part I need to manually change the size of the web part in the web part properties in sharepoint.&lt;/p&gt;
&lt;p&gt;Do you know why this occurs ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3669553</link><pubDate>Tue, 03 Jul 2007 13:33:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3669553</guid><dc:creator>Paul Robinson</dc:creator><description>&lt;p&gt;sounds bizarre. &amp;nbsp;off-teh-top-of-my-head I'd be thinking that changing the size is one way to invalidate the cache. &amp;nbsp;Perhaps your caching is configured such that MOSS doesn't recognise the new control has been added? &amp;nbsp;Just a thought.&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3675520</link><pubDate>Tue, 03 Jul 2007 23:12:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3675520</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;In the menu field I have been trying to add more than one TextField and then format it appropriatly. This works fine except I can not force a carriage return between the fields. You can see how I am trying to do this below...&lt;/p&gt;
&lt;p&gt;colMenu.TextFields = &amp;quot;DAV:displayname, DAV:href, Size, HitHighlightedSummary&amp;quot;;&lt;/p&gt;
&lt;p&gt;colMenu.TextFormat = &amp;quot;{0} \n {1}, Size:{2} \r\n {3}&amp;quot;;&lt;/p&gt;
&lt;p&gt;Do you know if it is possible ?&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3675657</link><pubDate>Tue, 03 Jul 2007 23:22:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3675657</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;P.S also tried &lt;/p&gt;
&lt;p&gt;colMenu.TextFormat = &amp;quot;{0}&amp;lt;br&amp;gt;{1}, &amp;nbsp;Size:{2} {3}&amp;quot;;&lt;/p&gt;
</description></item><item><title>re: Adding paging to SharePoint SPGridView when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3682807</link><pubDate>Wed, 04 Jul 2007 11:04:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3682807</guid><dc:creator>Paul Robinson</dc:creator><description>&lt;p&gt;Umm - when I saw you'd tried \r\n I thought I'd recommend &amp;lt;br&amp;gt; - but apparently not! &amp;nbsp;Good luck - please post if you find the answer.&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3709711</link><pubDate>Thu, 05 Jul 2007 20:40:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3709711</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;Nope never managed to solve this, It seems to take out all html coding as if using SPEncode.&lt;/p&gt;
&lt;p&gt;Had to go back to the beginning, drop the SPGridView and biuld the results in a table. Shame as I also have to code all the paging now as well.&lt;/p&gt;
&lt;p&gt;Still got one problem and that is it will only return up to 10 results ! Any idea why this would be. Is there a setting somewhere ?&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3723298</link><pubDate>Fri, 06 Jul 2007 11:37:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3723298</guid><dc:creator>Paul Robinson</dc:creator><description>&lt;p&gt;Oh dear dear. We can't have you resorting to tables when there's a lovely SPGridView. This will not stand Brian! &amp;nbsp;I'll take a look this weekend - it must be possible, right?&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#3726282</link><pubDate>Fri, 06 Jul 2007 16:06:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3726282</guid><dc:creator>Brian111</dc:creator><description>&lt;p&gt;Thanks, away next week so no rush and finished solution now but would be good to know for future. It beat me if it is possible ! Cheers&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#4152800</link><pubDate>Wed, 01 Aug 2007 00:11:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4152800</guid><dc:creator>shandao_song@hotmail.com</dc:creator><description>&lt;p&gt;It is a great posting so far. &lt;/p&gt;</description></item><item><title>I (L) SPGridView</title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#4292210</link><pubDate>Wed, 08 Aug 2007 15:00:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4292210</guid><dc:creator>Mirrored Blogs</dc:creator><description>&lt;p&gt;Currently I&amp;amp;#39;m busy with redeveloping some &amp;amp;#39;old&amp;amp;#39; 2003 webparts and quite often I used a .NET&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#4975835</link><pubDate>Tue, 18 Sep 2007 13:08:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4975835</guid><dc:creator>jordoman</dc:creator><description>&lt;p&gt;Thanks for a very useful post. I'm having trouble creating a PagerTemplate though. Rather than a few insignificant looking numbers at the bottom of the grid it would be nice to have links kind of like:&lt;/p&gt;
&lt;p&gt;First Prev 1 2 3 4 5 Next Last&lt;/p&gt;
&lt;p&gt;Do you think you might have time to update with a small example?&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#6744575</link><pubDate>Wed, 12 Dec 2007 12:55:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6744575</guid><dc:creator>divya028</dc:creator><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;When i use SPGridView its throws error as &amp;quot; Object reference not set to an instance of an object &amp;quot;.&lt;/p&gt;
&lt;p&gt;But if i use Datagrid it has no issues. i dont want to use datagrid since paging is not happening in it properly. kindly help &lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#6892703</link><pubDate>Sat, 29 Dec 2007 07:46:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6892703</guid><dc:creator>ArunDutt</dc:creator><description>&lt;p&gt;Hello Paul,&lt;/p&gt;
&lt;p&gt;Thank you for the nice article. I've tried your code and it is working. But I have a problem with the paging. I enabled the paging for the SPGridView, but the problem is the pager buttons are not visible. I really dont know what the problem is.&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8003655</link><pubDate>Mon, 03 Mar 2008 18:18:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8003655</guid><dc:creator>sberger75</dc:creator><description>&lt;p&gt;Can u send me the complete source code ?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8340952</link><pubDate>Fri, 28 Mar 2008 06:52:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8340952</guid><dc:creator>JayZeh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm also having some problems displaying the buttons.&lt;/p&gt;
&lt;p&gt;Were you guys able to solve this problem?&lt;/p&gt;
&lt;p&gt;Ive created a spgridview and put it on a table cell,&lt;/p&gt;
&lt;p&gt;the item counts are rendering properly but no paging links.&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8500874</link><pubDate>Tue, 13 May 2008 20:20:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8500874</guid><dc:creator>lpmeunier</dc:creator><description>&lt;p&gt;Anyone was able to find a solution to the paging buttons not displayed?&lt;/p&gt;
&lt;p&gt;I followed this article series using the SPGridView and so far everything has worked pretty well, but i can't seem to be able to get those paging links to show up. The item limit per page does work though, just not the paging links.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8578271</link><pubDate>Fri, 06 Jun 2008 18:52:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8578271</guid><dc:creator>pateketu</dc:creator><description>&lt;p&gt;Good post helped me get on with Paging in SPGridView, but I wanted more custom paging style like &amp;quot;Page 1 of 10&amp;quot;. &lt;/p&gt;
&lt;p&gt;Found a solution to do that by extending SPGridViewPager &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://ketulpatel.wordpress.com/2008/06/06/custom-paging-in-spgridview-extending-spgridviewpager/"&gt;http://ketulpatel.wordpress.com/2008/06/06/custom-paging-in-spgridview-extending-spgridviewpager/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8884722</link><pubDate>Thu, 21 Aug 2008 15:57:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8884722</guid><dc:creator>Oliver Wirkus</dc:creator><description>&lt;p&gt;Excellent article, Powlo - good job!&lt;/p&gt;
&lt;p&gt;I took the infos you posted here to build an example on how to use SPGridView with sorting, paging and filtering. I was able to display the sorting-icon and filtering-icon just like we know it from sharepoint lists.&lt;/p&gt;
&lt;p&gt;Here is the link - just in case someone is interessted :-)&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.sharepointblogs.com/wirkus/archive/2008/08/21/how-to-professionelle-datenanzeige-mit-dem-control-spgridview.aspx"&gt;http://www.sharepointblogs.com/wirkus/archive/2008/08/21/how-to-professionelle-datenanzeige-mit-dem-control-spgridview.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>SPGridView – sposób wykorzystania oraz ograniczenia</title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#8962818</link><pubDate>Wed, 24 Sep 2008 01:34:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962818</guid><dc:creator>.neting in the free world</dc:creator><description>&lt;p&gt;Nie raz już w r&amp;#243;żnych przypadkach podawałem wam linki odnoszące się do SPGridView , pora się temu trochę&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#9142114</link><pubDate>Tue, 25 Nov 2008 18:23:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9142114</guid><dc:creator>abis123</dc:creator><description>&lt;p&gt;Excellent blog and article. Got to be my main source of SPGridView information on the web.&lt;/p&gt;
&lt;p&gt;Quick question, if I apply paging and write out a count of results it only displays the amount per page (not total results). Do you know a way to return a count of all results with paging activated?&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#9399474</link><pubDate>Thu, 05 Feb 2009 21:39:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9399474</guid><dc:creator>vmoroz</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have built the web part with grouping an paging. The paging works just fine. But I have an issue. If I collapse the last group in last page the pager control disappears together with group rows. This is confusing our portal users. Does someone know how to let pager navigation stays on the bottom of page when last group is collapsed?&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#9408750</link><pubDate>Mon, 09 Feb 2009 17:42:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9408750</guid><dc:creator>lzandman</dc:creator><description>&lt;p&gt;Above I read that some users have problems with their paging buttons (they don't appear). A cause for this might be that the line where you set the PagerTemplate to null is in the wrong position.&lt;/p&gt;
&lt;p&gt;It needs to be executed AFTER the grid has been added to the Controls collection of its parent control. If this parent control itself is also contained in a control (as is often the case with composite controls), then you have to place the line with the PagerTemplate assignment after all those calls.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;SPGridView _grid = new SPGridView();&lt;/p&gt;
&lt;p&gt;Panel _panel = new Panel();&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;_panel.Controls.Add(_grid);&lt;/p&gt;
&lt;p&gt;Controls.Add(_panel);&lt;/p&gt;
&lt;p&gt;_grid.PagerTemplate = null;&lt;/p&gt;
</description></item><item><title>re: SPGridView: Adding paging to SharePoint when using custom data sources </title><link>http://blogs.msdn.com/powlo/archive/2007/03/23/Adding-paging-to-SPGridView-when-using-custom-data-sources.aspx#9799830</link><pubDate>Tue, 23 Jun 2009 19:55:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9799830</guid><dc:creator>bilalfastian</dc:creator><description>&lt;p&gt;Thanks for the nice Post.&lt;/p&gt;
&lt;p&gt;I am have a problem that, every thing renders properly first time data is bound, but as soon as I change the page, data still renders correctly but the alignment of first column is disturbed. It sticks to the left margin of Grid once I navigate from the first page. Even going back to first page does not restore it.&lt;/p&gt;
&lt;p&gt;My first column is a template field. I am not using any alignment related property with template field.&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
</description></item></channel></rss>