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

ASPxGridView.AutoFilterByColumn(GridViewColumn, String) Method

Applies a filter to the specified data column.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public void AutoFilterByColumn(
    GridViewColumn column,
    string value
)

Parameters

Name Type Description
column GridViewColumn

A GridViewColumn descendant that represents the data column within the ASPxGridView.

value String

A String value that specifies the filter string.

Remarks

Use the AutoFilterByColumn method to filter data in code.

The method call creates a filter condition based on the value parameter. This filter is then applied to the ASPxGridView. The comparison operator used in this filter condition is determined by the column’s GridViewDataColumnSettings.AutoFilterCondition property.

End-users can apply a filter via the Filter Row which is displayed when the ASPxGridViewSettings.ShowFilterRow option is enabled.

Note

String values that are passed via the value parameter and are supposed to be handled as numeric or DateTime values must be represented in the Invariant Culture format (see CultureInfo.InvariantCulture Property to learn more).

To learn more, see Filtering.

Example

The following code applies a filter that selects records that end with “development” in the Department column. The filter expression is displayed within the ASPxGridView’s Title Panel.

The image below shows the result:

ASPxGridView_FilterByColumn

ASPxGridView1.DataColumns["Department"].Settings.AutoFilterCondition = AutoFilterCondition.EndsWith;
ASPxGridView1.AutoFilterByColumn(ASPxGridView1.Columns["Department"], "development");
ASPxGridView1.SettingsText.Title = ASPxGridView1.FilterExpression;
See Also