Skip to main content

OptionsColumnFilter.AutoFilterCondition Property

Gets or sets the type of the comparison operator used to create filter conditions for the current column via the Automatic Filtering Row.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

[XtraSerializableProperty]
[XtraSerializablePropertyId(3)]
public virtual AutoFilterCondition AutoFilterCondition { get; set; }

Property Value

Type Description
AutoFilterCondition

An AutoFilterCondition value that determines the type of the comparison operator used to create filter conditions for the current column via the auto filter row.

Available values:

Show 13 items
Name Description
Default

The default condition depends on the column editor and column data type. For columns that use a text editor and contain strings (or display strings instead of actual non-string values and are filtered by these strings (see FilterMode)), this option enables the Contains condition. For all other columns, it enables the Equals condition.

Like

Like Selects records that match the entered pattern. Use the _ and % wildcards to omit one or multiple irrelevant characters.

Equals

Equals Selects records that are equal to the entered value.

Contains

Contains Selects records that contain the entered string.

BeginsWith

BeginsWith Selects records that start with the entered string. Equals to the Like clause with the % wildcard after the entered string. For example, the [Name] BeginsWith 'A' and [Name] Like 'A%' filter expressions are equal.

EndsWith

EndsWith Selects records that end with the entered string. Equivalent to the Like clause with the % wildcard before the entered string. For example, the [Name] EndsWith 'A' and [Name] Like '%A' filter expressions are equal.

DoesNotContain

DoesNotContain Selects records that do not contain the entered string. Equivalent to the NotLike clause with the % wildcard before and after the searched string. For example, the [Name] DoesNotContain 'AA' and [Name] NotLike '%AA%' filter expressions are equal.

DoesNotEqual

DoesNotEqual Selects records that do not equal the entered value. Opposite to the Equals clause.

Greater

Greater Selects records that are greater than the entered value. String values are compared according to their alphabetical order.

GreaterOrEqual

GreaterOrEqual Selects records that are greater than the entered value or equal to it. String values are compared according to their alphabetical order.

Less

Less Selects records that are less than the entered value. String values are compared according to their alphabetical order.

LessOrEqual

LessOrEqual Selects records that are less than the entered value or equal to it. String values are compared according to their alphabetical order.

NotLike

NotLike Selects records that do not match the entered pattern. Opposite to the NotLike clause. For example, the [Name] Like 'J%y' filter expression returns January and July for a month list. The [Name] Not Like 'J%y' expression returns all months except January and July.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoFilterCondition
GridColumn
.OptionsFilter .AutoFilterCondition

Remarks

When an end-user types text within the Automatic Filtering Row‘s cell, a filter condition is created based upon the text entered. This filter is then applied to the View. The comparison operator used in this filter condition is determined by the column’s AutoFilterCondition property.

See the AutoFilterCondition enumeration topic for information on the available types of operators.

The GridOptionsFilter.AllowAutoFilterConditionChange property controls whether end-users can change filter conditions in the auto filter row at runtime.

Example

In the following sample the AllowAutoFilterConditionChange property is disabled, Data Grid uses a default auto filter condition to filter records. The AutoFilterCondition property changes this default condition for the “Company Name” column from “Contains” to “Starts With”.

autoFilterCondition

gridView1.OptionsView.ShowAutoFilterRow = true;
gridView1.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False;
colCompanyName.OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.BeginsWith;
See Also