How to use Skip() and Take() with IQueryable
if I get you right you want to use your own implementation istead of loading all data and then using the PagedDataSource right?
If so you have to make sure that QueryGoesHere
is a Queryable supporting this (Linq2Sql or EF). Then you have to get the count of your date like this
var count = QueryGoesHere.Count();
and get the portion of data you want to display:
var skip = (curPageNumber - 1)*itemsPerPage;
var display = Math.Min(count - skip, itemsPerPage);
and just use
var displayedItems = QueryGoesHere.Skip(skip).Take(display).ToArray();
That should do the trick.