Hello
How do i check from code if a datagridcolumn has a filter active ?
Regards
Filippo
It depends on the filter panel, it could be anything. You can retrieve the filter panel on a column like this:
var panel = (ColumnFilterPanel)column.UserData.FilterPanel; // You can cast to your derived panel.
Now that you have the panel you can check the values or you can check the image on the button.
if (panel.FilterButton.ImageSource == panel.ColumnFilter.FilteredImageSource) {}
However, the best thing to do would be to add a property to ColumnFilterPanel and set it or clear it in ApplyFilters.
See source code here: https://github.com/iceteagroup/wisej-extensions/blob/master/Wisej.Web.Ext.ColumnFilter/ColumnFilterPanel.cs
Please login first to submit.