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
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
Hi,
I meant StartIndex as DataItemRequested args StartIndex property. Thank you for response. The problem was with VirtualCollection declaration. I specified the LoadSize as 10 while declaring a Virtual collection. Now I removed the Load size and just specified the Anticipated Count. It works fine.
Thank you.