A newer version of this page is available. Switch to the current version.

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.

Examples

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";
See Also