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

[Solved] How to use FilterDescription in MVVM Pattern

5 Answers 324 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.
Jebouy
Top achievements
Rank 1
Jebouy asked on 15 Oct 2009, 10:10 AM
Hi,

I am using MVVM pattern. I want to clear the Grid Filter on a button click.

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 15 Oct 2009, 02:27 PM
Hello jeb tom,

The only way to do this would be to attach to the button's click event and clear the GridViewDataControl.FilterDescriptors collection.

        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            this.playersGrid.FilterDescriptors.Clear();
        }

I hope this helps.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jebouy
Top achievements
Rank 1
answered on 16 Oct 2009, 06:43 AM
Hi, 


  I am using MVVM pattern. we are not using the code behind.  So i need to clear the FilterDescriptor in the View Model.
 
Thanks for your resoponse
0
Rossen Hristov
Telerik team
answered on 16 Oct 2009, 09:44 AM
Hi jeb tom,

The only way  you can do this is if you bind the grid to a QueryableCollectionView and create a Command that will operate directly on its filters.

Please, see the sample project attached. It can serve as a base and you can build upon it.

Sincerely yours,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Giovanni
Top achievements
Rank 1
answered on 18 Feb 2011, 03:51 PM
is this solution compatible with the last telerik silverlight version 2010 q3?

thanks
0
Rossen Hristov
Telerik team
answered on 18 Feb 2011, 04:00 PM
Hi Giovanni,

I believe that there is no reason not to be so.

But my suggestion would be to download the sample project, update the binaries and try whether it works just to make sure.

Greetings,
Ross
the Telerik team
Tags
GridView
Asked by
Jebouy
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jebouy
Top achievements
Rank 1
Giovanni
Top achievements
Rank 1
Share this question
or