How to know when a GridGroupingControl Filter has been cleared

NeitherGridExcelFilter.RecordFiltersItemChanged norTableDescriptor.RecordFilters.Changed events fire when a filter is removed. Is there another event I'm missing that fires when a filter is cleared?

Update: RecordFiltersItemChanged fires, but not with the empty filter - perhaps the event is firing incorrectly in your code?

1 Reply

AR Arulpriya Ramalingam Syncfusion Team December 6, 2017 05:26 PM UTC

Hi David, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your requirement and the GridExcelFilter does not have the direct support to notify the action of ClearFilter with event on GridExcelFilter. This can be identified by using the CategorizedRecords event based on the condition. Filtered records of GridExcelFilter will be maintained in the FilterCollection and the count of FilterCollection will be zero (i.e. 0) when the filters are cleared. So, the condition can be added in the CategorizedRecords event to identify that the filters are cleared or not. We have created a simple sample as per your requirement and please make use of below code and sample, 
 
Code example 
 
//Event triggering 
this.gridGroupingControl1.TableDescriptor.CategorizedRecords += TableDescriptor_CategorizedRecords; 
 
//Event customization 
private void TableDescriptor_CategorizedRecords(object sender, TableEventArgs  
{ 
    //To identify the clear filter action 
    if (filter.FilterCollection != null && filter.FilterCollection.Count == 0) 
    { 
         //Code to customize the action 
    } 
} 
 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon