Skip to main content
A newer version of this page is available. .

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.v19.2.dll

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

For columns being filtered by their display text (see GridColumn.FilterMode), the Default option acts identically to the Like option.

The Default option acts like the Equals option for the columns that have any of the following in-place editors or any of their descendants: CheckEdit, LookUpEditBase or ImageComboBoxEdit.

For other columns, the Default option acts identically to the Like option.

Like

The Like comparison operator selects records whose values in the corresponding column match the entered string. Use the “” and “%”_ wildcards to omit one or multiple irrelevant characters respectively.

For the columns that use CheckEdit, LookUpEditBase or ImageComboBoxEdit in-place editors, the Equals operator is always used, unless these columns are filtered by display text (see GridColumn.FilterMode).

Equals

The Equals comparison operator selects records whose values in the corresponding column match the entered value.

Contains

The Contains operator selects records whose values in the corresponding column contain the entered string.

BeginsWith

Selects records that start with the entered string. Equal to the AutoFilterCondition.Like clause with the “%” wildcard after the searched string.

For example, the [Name] BeginsWith ‘A’ and [Name] Like ‘A%’ filtering expressions are equal.

EndsWith

Selects records that end with the entered string. Equal to the AutoFilterCondition.Like clause with the “%” wildcard before the searched string.

For example, the [Name] EndsWith ‘A’ and [Name] Like ‘%A’ filtering expressions are equal.

DoesNotContain

Selects records that do not contain the entered string. Equal to the AutoFilterCondition.NotLike clause with the “%” wildcard before and after the searched string.

For example, the [Name] DoesNotContain ‘AA’ and [Name] NotLike ‘%AA%’ filtering expressions are equal.

DoesNotEqual

Selects records that do not equal the entered string. This clause acts as an opposite to the AutoFilterCondition.Equals clause.

Greater

Selects records that are greater than the entered value.

For text records, “greater” values are those that would lie below the entered value in an alphabetically sorted list. For example, in a list with Latin characters, all letters from “N” to “Z” are greater than the letter “M”.

GreaterOrEqual

Selects records that are greater than the entered value or equal to it.

For text records, “greater” values are those that would lie below the entered value in an alphabetically sorted list. For example, in a list with Latin characters, all letters from “M” to “Z” are greater or equal to the letter “M”.

Less

Selects records that are less than the entered value.

For text records, “less” values are those that would lie above the entered value in an alphabetically sorted list. For example, in a list with Latin characters, all letters from “A” to “L” are less than the letter “M”.

LessOrEqual

Selects records that are less than the entered value or equal to it.

For text records, “less” values are those that would lie above the entered value in an alphabetically sorted list. For example, in a list with Latin characters, all letters from “A” to “L” are less than the letter “M”.

NotLike

Selects records that do not match the entered string. Acts as an opposite to the AutoFilterCondition.Like clause.

For example, from a list with month names the [Name] Like ‘J%y’ filter expression will return the “January” and “July” records. The [Name] Not Like ‘J%y’ expression will return the names of remaining ten months.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoFilterCondition
GridColumn
.OptionsFilter.AutoFilterCondition
LayoutViewColumn
.OptionsFilter.AutoFilterCondition
BandedGridColumn
.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;

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoFilterCondition 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