Skip to main content

SelectQuery.FilterString Property

Specifies the criteria used to filter data returned by the current SelectQuery.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v23.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap


public string FilterString { get; set; }

Property Value

Type Default Description
String null

A String value, specifying the filter criteria.


The FilterString property allows you to filter the result set returned by SelectQuery by specifying the required filter criteria. To filter a SelectQuery by specified column values, precede a column name with a corresponding table name. For instance, you can filter the SalesPerson table by the Beverages category in the following way.

SelectQuery query = new SelectQuery("Query 1");
query.AddTable("SalesPerson").SelectColumns("CategoryName", "Extended Price");
query.FilterString = "[SalesPerson].[CategoryName] = 'Beverages'";

To pass a QueryParameter (which can be accessed using the SqlQuery.Parameters property) to the filter string, precede the parameter name with the ? sign.

QueryParameter queryParam1 = new QueryParameter("Parameter1", typeof(string), "Beverages");
query.FilterString = "[SalesPerson].[CategoryName] = ?Parameter1";


If a table or column name includes dots, enclose the table/column name in square brackets.

For example, if you have a table with the “” name and a column with the “” name, refer to the column in the following manner: [[\].[\]]. If you have only the column name with a dot, refer to it as follows: [tablename.[\]]. As you can see, you should use \ to avoid closing the expression beforehand.

To learn more about building filter criteria, see Simplified Criteria Syntax.

The following code snippets (auto-collected from DevExpress Examples) contain references to the FilterString property.


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