ColumnView.ColumnFilterChanged Event
Occurs when a column’s filter condition changes. This event also raises when the Find Panel finishes its search.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v19.2.dll
Declaration
Event Data
The ColumnFilterChanged event's data class is EventArgs.
Remarks
If the column’s OptionsColumnFilter.AllowFilter option is enabled, users can use the column’s Filter DropDown or the column header context menu to change filter conditions. To change filter conditions in code, modify the GridColumn.FilterInfo property.
You can also apply filters by multiple columns. Refer to the Filter and Search topic for more details.
Each time a column filter condition changes, the ColumnFilterChanged event occurs.
The code sample below illustrates how to detect if the user has applied any filters to the grid.
using DevExpress.XtraGrid.Views.Grid;
..
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
GridView view = sender as GridView;
if (view.ActiveFilterString == "")
XtraMessageBox.Show("The grid has no filters applied");
else
XtraMessageBox.Show(string.Format("The grid has the following filter applied: {0}", view.ActiveFilterString));
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColumnFilterChanged event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.