SeriesBase.FilterString Property

Gets or sets the current filter expression.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Data)]
[DefaultValue("")]
public string FilterString { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Data)>
<DefaultValue("")>
Public Property FilterString As String

Property Value

Type Default Description
String

String.Empty

The current filter expression.

Remarks

Use the FilterString property to specify a filter expression that consists of multiple conditions applied to multiple data columns, and apply it to the series' data. Setting the FilterString property to a new value clears any filters that have been previously applied.

Note that the FilterString and SeriesBase.FilterCriteria properties are dependent. If you update one of them, the other changes as well.

Use Criteria Language Syntax to create a filter expression. Then, assign the expression to the FilterString property:

Series series = chartControl1.Series[0];
series.FilterString = "CategoryID = 1 Or CategoryID = 3 Or CategoryID = 7";

Alternatively, you can use the FilterCriteria property to set the filter expression. See Criteria Operators for information on supported syntax.

Series series = chartControl1.Series[0];
series.FilterCriteria = new BinaryOperator("CategoryID", 1, BinaryOperatorType.Equal) |
                        new BinaryOperator("CategoryID", 3, BinaryOperatorType.Equal) |
                        new BinaryOperator("CategoryID", 7, BinaryOperatorType.Equal);

You can also use the CriteriaOperator.Parse method to convert a filter string to its CriteriaOperator equivalent as follows:

Series series = chartControl1.Series[0];
series.FilterCriteria = CriteriaOperator.Parse("CategoryID = 1 Or CategoryID = 3 Or CategoryID = 7");
See Also