ASPxGridBase.FilterExpression Property
Gets or sets the filter criterion which is applied to the grid.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A String value that specifies the filter criterion. |
Remarks
Concept
Examples
The following examples illustrate different scenarios on how to filter the grid data.
Filter data by dates.
Applying a filter that selects departments whose budget is greater than 100,000 and that are located in Monterey. The filter criteria are displayed within the ASPxGridView’s Title Panel.
ASPxGridView1.FilterExpression = "[Budget] > 100000 AND [Location] = 'Monterey'"; ASPxGridView1.SettingsText.Title = ASPxGridView1.FilterExpression;
Result:
Select data rows whose product name starts with “ch”.
Get field names from the filter expression value.
int start = -1; List<string> fields = new List<string>(); for (int i = 0; i < ASPxGridView1.FilterExpression.Length; i++) { if (ASPxGridView1.FilterExpression[i] == '[') start = i; if (ASPxGridView1.FilterExpression[i] == ']') { fields.Add(ASPxGridView1.FilterExpression.Substring(start + 1, i - start - 1)); start = -1; } }
Online Demos
GitHub Example
- How to apply custom function filter criteria operators
- How to programmatically change a column’s filter criterion in the grid’s filter expression
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FilterExpression 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.