Paging documentation anywhere?

18 views
Skip to first unread message

Sam

unread,
Dec 11, 2009, 5:17:17 PM12/11/09
to mvccontrib-discuss
I can't seem to find any documenation on using paging in mvccontrib2.
Can someone point me in the right direction?

Jeremy Skinner

unread,
Dec 12, 2009, 5:46:14 AM12/12/09
to mvccontri...@googlegroups.com
There currently isn't any specific documentation for the paging support, although I do cover it in my blog posts on the grid. Do you have any particular questions about it? If so, I'd be happy to answer them.

Jeremy

2009/12/11 Sam <sam...@gmail.com>
I can't seem to find any documenation on using paging in mvccontrib2.
Can someone point me in the right direction?

--
Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project.  Or go to http://mvccontrib.org

To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en

Sam De La Garza

unread,
Dec 12, 2009, 7:51:40 AM12/12/09
to mvccontri...@googlegroups.com, mvccontri...@googlegroups.com
Ok. I did see how to implement lazy paging, but I'd like to see the other ways to implement it as well. 

Thanks!

Sam

Sent from my iPhone

Jeremy Skinner

unread,
Dec 12, 2009, 7:57:37 AM12/12/09
to mvccontri...@googlegroups.com
There are two implementations of IPagination - LazyPagination and CustomPagination.

When you use the AsPagination extension method on IEnumerable, by default this will create a LazyPagination which uses LINQ's Take/Skip functionality to page the collection the first time it is enumerated.

CustomPagination allows you to implement your own paging mechanism (for example, if you have already pre-paged your data in the database), in which case you can just new it up and pass in the required information:

var pagination = new CustomPagination<Person>(myAlreadyPagedCollectionOfPerson, currentPageNumber, pageSize, totalNumberOfItems);

So this will not perform any paging for you automatically, but instead infer that you have already paged the data yourself via whatever mechanism.

Jeremy

2009/12/12 Sam De La Garza <sam...@gmail.com>

Sam Dlg

unread,
Dec 14, 2009, 5:16:54 PM12/14/09
to mvccontri...@googlegroups.com
awesome thanks!
Reply all
Reply to author
Forward
0 new messages