I'm trying to figure out the best way to implement this with the RadGridView. I have a WCF service with a client callback. I invoke the service to begin a query, and it invokes the callback multiple times as results are known. It has to be this way, because the results come streaming in, must begin to appear quickly, and I have no idea how many results there will be up front.
Right now I'm implementing this completely in a ViewModel: exposing the set of results as an ObservableCollection which is being added to as results arrive. I also have various mechanisms in place to cancel outstanding queries, and ensure results from different instances of the query don't overlap.
This makes it difficult to use the built in Filter and Sort controls of the RadGridView. All of my sort and filter controls are currently custom, and outside of the RadGridView, so that they can be directly bound to properties of the ViewModel. When those properties change, the ViewModel cancels and clears the last query/results, and begins a new one.
I'd like a way to use the build in Filter/Sort controls. They all seem to require, to be used properly, that the bound collection be a CollectionView of some fashion. I'm fine with that. I can alter my ViewModel to expose one of those instead. The problem is I cannot figure out how to deal with the async delivery into this CollectionView. How do I do this? If I implement my logic in the Refresh method, how do I deliver the results asynchronously?
QueryableCollectionView seems to require an IEnumerable as a source. I don't have one. That needs to be built as filters/sorts are changed.
VirtualQueryableCollectionView seems the closest: but it seems to require knowing the total item count up front, which I do not and cannot know.
My only apparent option at this point, as far as I can tell, is to implement my own ICollectionView. Is this my remaining option?
Right now I'm implementing this completely in a ViewModel: exposing the set of results as an ObservableCollection which is being added to as results arrive. I also have various mechanisms in place to cancel outstanding queries, and ensure results from different instances of the query don't overlap.
This makes it difficult to use the built in Filter and Sort controls of the RadGridView. All of my sort and filter controls are currently custom, and outside of the RadGridView, so that they can be directly bound to properties of the ViewModel. When those properties change, the ViewModel cancels and clears the last query/results, and begins a new one.
I'd like a way to use the build in Filter/Sort controls. They all seem to require, to be used properly, that the bound collection be a CollectionView of some fashion. I'm fine with that. I can alter my ViewModel to expose one of those instead. The problem is I cannot figure out how to deal with the async delivery into this CollectionView. How do I do this? If I implement my logic in the Refresh method, how do I deliver the results asynchronously?
QueryableCollectionView seems to require an IEnumerable as a source. I don't have one. That needs to be built as filters/sorts are changed.
VirtualQueryableCollectionView seems the closest: but it seems to require knowing the total item count up front, which I do not and cannot know.
My only apparent option at this point, as far as I can tell, is to implement my own ICollectionView. Is this my remaining option?