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

GridView Custom Clear Filter Button

5 Answers 168 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark Reynolds
Top achievements
Rank 1
Mark Reynolds asked on 09 Apr 2012, 06:57 PM
 have a custon rad button which clear the grid filters. userGrid.FilterDescriptors.Clear();

But after the clear i still have the filter Control Check boxes checked. What should be done to clear the check boxes. attached is the image of the error

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 10 Apr 2012, 07:55 AM
Hello,

 In order to clear the check boxes, you will have to clear the filters for the column. For example:

private void Button_Click(object sender, RoutedEventArgs e)
{
    this.clubsGrid.Columns["Name"].ClearFilters();
}

Calling ClearFilters() will automatically remove filter descriptor from the grid.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mark Reynolds
Top achievements
Rank 1
answered on 10 Apr 2012, 03:48 PM
FilterDescriptors.Clear() method clears the checkboxes with SL4.Is this a new enhancement in with SL5.
Our Application has about 50-60 gridviews , would there be a fix to clear all checkboxes when the grids FilterDescriptors.Clear() is invoked, instead of coding for each column
0
Dimitrina
Telerik team
answered on 10 Apr 2012, 04:10 PM
Hi,

Indeed, we have introduced breaking changes with the Q1 2012 version of the Controls. Please check here for detailed information on all the changes done.

The changed code, in your case, would look like so:

this.radGridView.FilterDescriptors.SuspendNotifications();
foreach (Telerik.Windows.Controls.GridViewColumn column in this.radGridView.Columns)
{
    column.ClearFilters();
}
this.radGridView.FilterDescriptors.ResumeNotifications();

Simply calling RadGridView.FilterDescriptors.Clear will indeed remove the filtering, but the column filters will preserve their settings (although they will not be part of the FilterDescriptors collection). To completely clear a column filter you have to call column.ClearFilters(); 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
saw
Top achievements
Rank 1
answered on 30 Oct 2014, 02:44 PM
Hi,
I am using this column.ClearFilters() method in my Reset button (And also clear radGridView.GroupDescriptors.Clear(), radGridView.SortDescriptors.Clear()), .
But it will not clear the RadGrid.FilterDescriptors.Count . I need FilterDescriptors collection for my RadGrid search.

How I over come this problem ?
0
Dimitrina
Telerik team
answered on 31 Oct 2014, 12:13 PM
Hi,

Indeed, the FilterDescriptors will still be available right after you clear the column filters. Still, they will be cleared after all the notifications are restored. I checked the descriptors on a button click after clearing the defined user criteria and their count was 0. Would you please share more details on when do you need to use the FilterDescriptors collection?

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Mark Reynolds
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Mark Reynolds
Top achievements
Rank 1
saw
Top achievements
Rank 1
Share this question
or