Search code examples
wpffilterinfragisticsxamdatagrid

Determine filter status on a xamDataGrid


In a WPF app I'm developing I'd like to programmatically determine if a xamDataGrid has any filters configured or not.

I've configured an export function to Excel and would like to do a quick check to determine if a filter is active or not, if a filter is active then I'll present the user with the option to export filtered rows or not...

I can't find any suitable class members.

Any ideas?


Solution

  • Found the answer guys n girls...

        var activeFilterCount = xamDataGrid1.FieldLayouts[0].RecordFilters.Sum(recordFilter => recordFilter.Conditions.Count);