I am trying to populate records on a gridview depending on the result of two linq methods:
GetRecords(string SearchCriteria, int skip, int take)
which provides me the ammount of rows i´m going to show into the gridview, and
CountRecords(string SearchCriteria)
Which provides me with the total count of the records.
First I get the number of records by using the CountRecords method, and then I calculate the number of pages to make the user know how many pages the gridview has, but the property gridview.PageCount is read only. How can i set the ammount of pages the gridview is going to have, without getting all the records (they’re about 300000, so i cannot afford this option)?
Set virtual count. Set AllowCustomPaging to true.
http://msdn.microsoft.com/en-us/library/zxdbyxtc.aspx