Filters applied to SfDataGrid can be cleared by calling SfDataGrid.ClearFilters. As the requirement is to clear filter using HeaderContextMenu, define ContextMenu for Header using SfDataGrid.HeaderContextMenu property. In the following XAML code, the ContextMenu is defined with one MenuItem for HeaderContextMenu.
The Command property in MenuItem is bound with the ContextMenuCommand.ClearFiltering command that is defined in the code example. The following code example is for ContextMenuCommands static class with ClearFiltering command property in it. MenuItem in HeaderContextMenu gets the GridColumnContextMenuInfo as command parameter, when the action is triggered. GridColumnContextMenuInfo has the following properties, from which you can clear the filters for particular column or for the all GridColumns.
In the following ClearFiltering action, the filters are cleared for all columns by using SfDataGrid.ClearFilters() method.
Now, you can see ContexMenu when you right click on the column header of SfDataGrid, as in the following screenshot.
You can refer the sample from the following location,
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:|
or the page will be automatically redirected to sign-in page in 10 seconds.