Skip to main content

ColumnView.ActiveFilterCriteria Property

Gets or sets the current filter criteria.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.1.dll

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

Declaration

[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
[Browsable(false)]
public CriteriaOperator ActiveFilterCriteria { get; set; }

Property Value

Type Description
CriteriaOperator

A CriteriaOperator object which represents the total filter criteria.

Remarks

You can use the ActiveFilterCriteria property to specify the filter criteria in code, using CriteriaOperator objects. To specify the filter criteria in string format, see the ColumnView.ActiveFilterString property.

Example

The following code demonstrates how to create the following filter criteria via the ColumnView.ActiveFilterCriteria property, using the GroupOperator and BinaryOperator objects:

“[Extension] = ‘.gif’ OR [Extension] = ‘.png’”

using DevExpress.Data.Filtering;

CriteriaOperator expr1 = new BinaryOperator("Extension", ".gif");
CriteriaOperator expr2 = new BinaryOperator("Extension", ".png");
gridView1.ActiveFilterCriteria = GroupOperator.Or(new CriteriaOperator[] { expr1, expr2 });

To temporarily disable the filter, use the ColumnView.ActiveFilterEnabled option.

The ActiveFilterCriteria and ColumnView.ActiveFilterString properties can’t be used to filter data against a field that isn’t represented by a column in the current View.

The ActiveFilterCriteria property is equivalent to the ViewFilter.Criteria property of the ColumnView.ActiveFilter object.

For more information on filtering, see Filter and Search.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ActiveFilterCriteria property.

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.

See Also