Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ColumnView.ActiveFilter Property

Gets an object which returns information on the filter criteria applied to the View.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
[DXCategory("Behavior")]
public ViewFilter ActiveFilter { get; }

#Property Value

Type Description
ViewFilter

A ViewFilter object representing the filter criteria for the current View.

#Remarks

To specify the filter criteria, use the ColumnView.ActiveFilterString or ColumnView.ActiveFilterCriteria property.

The ActiveFilter property of the ViewFilter class provides a number of properties which return details on the current filter criteria applied to the view:

  • The indexer (ViewFilter.Item) returns the filter criteria applied to each column in the View.

Refer to the following help topic for more information: Filter and Search.

#Example

The following code shows how to add a filter condition to a View via its ColumnView.ActiveFilter object. The filter condition selects records whose CategoryName fields start with ‘c’.

using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Columns;
//...
ColumnView view = gridView1;
view.ActiveFilter.Add(view.Columns["CategoryName"], 
  new ColumnFilterInfo("[CategoryName] Like 'c%'", ""));
See Also