Hello.
I want to use server-side paging.
I have a XamGrid bounded on VirtualCollection<>.
I used ItemDataRequested event. When it fires, I get data from RIA service async.
As a parameters sent to service i use
(int startIndex, int itemsCount, SortDescriptionCollection sortDescriptions)
So, sorting works supposed.
But when grouping in the XamGrid I want to first loaded a number of groups (eg 5) and when opening group, entities, belonging that group should load.
There is any solution?
Ask if any question plz.
BR
Alexey Lukyanov
Hi Alexey,
Unfortunately, the behavior you're looking for isn't possible. We don't perform the grouping ourselves, we mainly rely on linq to perform the operation. And in the case of a VC, which is a CollectionView, we rely on it's implementation of grouping, which always returns the children rows.
-SteveZ
Understood.
Steve, maybe there is a solution without VC?
Сould there another implementation of server-side "paging" or another way to reduce data recieved from server to client?
I'm not very familiar with this subject.
And some additional questions:
1) There is a way to clear VirtualCollection?
2) How I can fire ItemDataRequested event in case if I use some custom filtering criteria( not assigned with XamGrid) and they(criteria) are changed, so I should update VirtualCollection?
Thanks.
Hi,
This method will invalidate its cached items and fire CollectionChanged event with Action Refresh which will cause the data-bound control (e.g the XamGrid) to refresh it's items. Since XamGrid has rows virtualization, it will reread the items from the VC and refresh the corresponding visible rows.
You have little control and no direct access to items that are cached by VC.
HTH,
Hi, Stoimen
Is Refresh() remove all cached items from VC? Or for remove all cached items I should do something else?
And how I can get real count of items which are now stored in the VC?
What you need is probably the Refresh() method of VC?