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

[Solved] RadGridView - filters - MVVM

4 Answers 337 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
guillaume
Top achievements
Rank 1
guillaume asked on 13 Dec 2010, 03:03 PM
Hi,
I choose a filter on a RadGridView ( img1.png) ,
I save the filter (xml file) ,
and I close the application.

When I open the same file, I load my backup :

private void FillFilter<T>(QueryableCollectionView collection, ObservableCollection<T> filters)
       {
           foreach (T item in filters)
           {
               collection.FilterDescriptors.Add(new FilterDescriptor(
                   "Code",
                   FilterOperator.IsEqualTo,
                   item.GetType().GetProperty("Code").GetValue(item, null).ToString()
                   , true));
           }
       }


It display the good result but my filter(s) do(es) not appear in the column (cf. img2.png)


Is there a way to display the filters in the column?
Thanks.

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 13 Dec 2010, 03:11 PM
Hi guillaume,

You need to use the ColumnFilterDescriptor instead of the FilterDescriptor in this case.

Best wishes,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
guillaume
Top achievements
Rank 1
answered on 13 Dec 2010, 04:37 PM
Ok thanks for the answer, but I develop with MVVM...

I use a QueryAbleCollectionView in my "ViewModel" and I binds it to a RadGridView which is in my "View".

I do not have access to a RadGridView, just to a QueryAbleCollectionView :(

0
Veselin Vasilev
Telerik team
answered on 14 Dec 2010, 11:28 AM
Hello guillaume,

I suppose you will still need to write some code to achieve what you want.

Greetings,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Jonas
Top achievements
Rank 1
answered on 28 Jun 2011, 07:36 AM
How come that RadGridView among other controls from Telerik is not working with MVVM?!? This is really FUNDAMENTAL! 
Tags
GridView
Asked by
guillaume
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
guillaume
Top achievements
Rank 1
Jonas
Top achievements
Rank 1
Share this question
or