How to programmatically clear the XamGrid filters?

[Infragistics] Petar Monov / Friday, May 13, 2011

In order to remove the filtering, the XamGrid exposes FilteringSettings.RowFiltersCollection.Clear(), but this only removes the filtering of the first level of data and also the text in the Filter cells is left behind. 

What you can do is access the filter row, through the  RowManager (filtering changes the rows collection and if you filter out all your records you cannot access RowManager, so you first have to clear the RowFiltersCollection). Once you have it you can iterate its cells and clear their values in order to get rid of the text that was left behind.

Another setback is that GroupByRows form additional levels of data, so iterating through all levels of data gets harder.

Here is a sample application that I have been working on that clears all filters in the XamGrid throughout all levels of data and GroupByRows inside them (