We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Clear all filters

is there a way how user can easily clear all filters?
The best solution would be to have new button displayed in GridRowHeaderIndentCell when some filter is set. Clicking it would clear all filters.
Is there a way how to do it?


1 Reply

DB Dinesh Babu Yadav Syncfusion Team May 17, 2019 02:35 AM

Hi Ondra,             
Thanks for using Syncfusion products. 
If you want to clear the filtering by clicking on the RowHeaderIndentCell, you can use the ControlTemplate to load the button and wire the click event to perform the clear filter action. Refer to the following code snippet, 
Code Snippet: 
Xaml code 
<Style TargetType="syncfusion:GridRowHeaderIndentCell"> 
    <Setter Property="Template"> 
            <ControlTemplate TargetType="syncfusion:GridRowHeaderIndentCell"> 
                <Border x:Name="PART_RowHeaderCellBorder" 
                BorderBrush="{TemplateBinding BorderBrush}" 
                BorderThickness="{TemplateBinding BorderThickness}"> 
                        <!--Load the Button to clear the filter --> 
                        <Button Content="x" Click="ClearFilter" /> 
private void ClearFilter(object sender, RoutedEventArgs e) 
    //Clear all the filters from the SfDataGrid. 
You  can also refer to the following KB document to clear all the column filters by using the context menu, 
Dinesh Babu Yadav 

Live Chat Icon For mobile
Up arrow icon