Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1810
Server Side Pagination using Virtual Collection in XamWebGrid
posted

I have one doubt in the Virtual Collection, Say we have total 25 records and the Page size is 10 so the total page's are 3. VirtualCollection works on the basis of start index, basically in the first page start Index is zero, 2nd page start index is 10 but when I go to 3rd page start Index is 15, i think this is wrong why because in my 3rd page I want to show only 5 records i.e from 20 to 25. Which is not happening in Virtual Collection. Am I assuming anything wrong?

Thank you

Parents
  • 6759
    Offline posted

    Hi ptilwani,

    I am not sure what do you mean when you say "Virtual Collection works on the basis of start index".

    If by StartIndex you mean DataItemRequested args StartIndex property then  you've probably mixed the paging and caching. StartIndex and DataItemRequested are not directly related to the paging capabilities. Basically when the XamGrid needs to display a certain page it tries to access the items from that page then VC searches its cache for requested by the grid Items. If they are not in the cache VC requests the items by firing the DataItemRquested for those items that are not in the cache. And finally when they are loaded into the cache they are displayed.

    I've attached a sample solution you could check out.

    Regards

    VCSample.zip
Reply Children