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

Programmatically Removing All FilterDescriptors for a Single Silverlight GridViewDataColumn

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 09 Sep 2011, 01:37 PM
Greetings.

Does anyone know how to remove programmatically all of the FilterDescriptors for a single GridView column? I know how to remove all descriptors from the grid:

_grid.FilterDescriptors.Clear();

However, it escapes me how to remove the descriptors only for a single column using the column's UniqueName.

Thanks for any assistance you can provide.

- Steve 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 12 Sep 2011, 11:52 AM
Hello Stephen,

The descriptors added by the end-user through the UI are special and are called ColumnFilterDescriptor. They have a reference to their respective column. You can learn about them here.

So, if you debug your app you will notice that for each column with active filter there will be one such ColumnFilterDescriptor in the FilterDescriptors collection. Since this ColumnFilterDescriptor has a property called Column, you can use that to uniquely identify which column is this descriptor for.

I hope this helps.

Kind regards,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Stephen
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or