Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Effectively paging SharePoint List Items to bind to an ASP.NET gridview with pagination

$
0
0

Hi all,

I'm currently having a web part which displays items pulled from a list in a ASP.NET grid view.

My requirements - 

  1. Provide pagination in gridview, just Next and Prev (datasource should be paged too)
  2. Provide filtering option

I already knew that we can do the paging while retrieving the items using ListItemCollectionPosition property of SPQuery.

But I'm finding it impossible to build the paging info when I've the following scenarios - 

  1. When some items are deleted in the list (so item IDs are not continuous)
  2. When items are filtered

In the above two scenarios I believe it is impossible to identify the p_ID in the PagingInfo correctly. Any ideas how to achieve this? Or can we say that pagination at the list items level is not possible under all scenarios?

How does a list view page automatically append the necessary information in the query parameters? How SharePoint is doing it?

Already referred - 

https://blog.metrostarsystems.com/2011/03/16/paging-within-list-views-in-sharepoint-2010-using-splistitemcollectionposition/

http://charliedigital.com/2010/02/05/paging-with-splistitemcollectionposition/

http://blogs.msdn.com/b/colbyafrica/archive/2009/02/19/learning-sharepoint-part-vi-list-pagination.aspx



NLV - MCTS - Blog - Twitter - In



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>