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.v20.1.dll

Declaration

[DXCategory("Property Changed")]
public event EventHandler ColumnFilterChanged
<DXCategory("Property Changed")>
Public Event ColumnFilterChanged As EventHandler

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));

}
See Also