[SOLVED] Issue on ColumnFIlter

Answered
0
0

 

Hello

How do i check from code if a datagridcolumn has a filter active ?

 

Regards

Filippo

  • You must to post comments
Best Answer
0
0

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

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.