This is a migrated thread and some comments may be shown as answers.

GridView Filter Results with MVVM

2 Answers 94 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Monte Baker
Top achievements
Rank 2
Monte Baker asked on 15 Nov 2010, 03:22 PM
Do you have any examples capturing the results of a filtered grid into a collection with MVVM.

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Nov 2010, 04:44 PM
Hi,

You can easily achieve this if you bind the grid to QueryableCollectionView since the grid in this case will work directly with the collection FilterDescriptors. 

Regards,
Vlad
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
Madhu
Top achievements
Rank 1
answered on 16 Mar 2011, 02:30 PM
Hi Vlad,

Per your suggestion, I bound my grid to QueryableCollectionView. After the user applies the filter (via UI), I step through the code and find that the QueryableCollectionView has only the filtered collection items (Result Collection), which is good.

Now, my question is how do I

1) Apply LINQ operations on the Result Collection? ".Where" does not work
        2) Cast the ResultCollection to SourceCollection Type? The only property i find is SourceCollection, which returns the entire sourcecollection. But, I want the ResultCollection type casted to the SourceCollection type. If do cast using "as" or put a type before ResultCollection, the code throws exception. "Cannot Cast"

Please suggest and provide a sample showing QueyableCollectionView using LINQ operations.

Thanks
Tags
GridView
Asked by
Monte Baker
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Madhu
Top achievements
Rank 1
Share this question
or