ColumnView.ActiveFilterString Property
Gets or sets the total filter expression for the current View.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v18.2.dll
Declaration
[XtraSerializableProperty(1000)]
[XtraSerializablePropertyId(3)]
[Browsable(false)]
[DefaultValue("")]
public string ActiveFilterString { get; set; }
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string that specifies the total filter expression applied to the current View. |
Remarks
Reading the ActiveFilterString property returns the value of the ViewFilter.Expression property of the ColumnView.ActiveFilter object.
Assigning any filter string to the ActiveFilterString property clears any filters that have been previously assigned, and then applies a new filter expression to the View.
The ActiveFilterString and ColumnView.ActiveFilterCriteria properties can’t be used to filter data by a field that isn’t represented by a column in the current View.
Example
This example demonstrates how to assign a filter to a View using the ColumnView.ActiveFilterString
property.
gridView1.ActiveFilterString = "([ProductID] = 1 OR [ProductID] = 3 " +
"OR [ProductID] > 10) AND [Discount] = 0";
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ActiveFilterString 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.