Skip to main content

SeriesBase.FilterString Property

Gets or sets the current filter expression.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.2.dll

Declaration

[DefaultValue("")]
[XtraChartsLocalizableCategory(XtraChartsCategory.Data)]
public string FilterString { get; set; }

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");

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FilterString 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.

See Also