CriteriaOperator.Parse(String, Object[]) Method
Converts the specified string, specifying an expression, to its CriteriaOperator equivalent.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v24.1.dll
NuGet Package: DevExpress.Data
Declaration
Parameters
Name | Type | Description |
---|---|---|
criteria | String | A String value, that is the expression to convert. |
parameters | Object[] | The values that are substituted into the expression in place of question mark characters. These parameters can be omitted. |
Returns
Type | Description |
---|---|
CriteriaOperator | A CriteriaOperator equivalent to the expression contained in criteria. |
Remarks
This example retrieves the cars that belong to the Saloon category and cost less than $100,000.
xpCollection1.Filter = CriteriaOperator.Parse("[Category] = ? AND [Price] < ?", "Saloon", 100000);
The image below shows the result:
To learn more, see Limitations of CriteriaOperator.Parse and Criteria Language Syntax.
Note
The code example above uses positional parameters to format a criteria expression with values. For more information on positional parameters, refer to the corresponding section in the Criteria Language Syntax topic.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Parse(String, Object[]) method.
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.