Skip to main content

TcxFilterCriteriaItem.Expression Property

Specifies a calculated expression for a filter condition.

Declaration

property Expression: string read; write;

Property Value

Type
string

Remarks

Use this property to assign a calculated expression to a simple filter condition.

You can compare an expression result and an item‘s value. Create an expression and add it to a condition with the TcxFilterCriteria.AddExpressionItem or filter condition list’s AddExpressionItem functions.

Expressions in filter criteria and calculated fields follow the same syntax. Refer to the TcxCustomItemDataBinding.Expression property description for details and syntax examples.

The following data controller types do not support calculated expressions:

The code example below shows how to replace a filter condition’s expression with a new expression:

var
  AExpression: string;
  ACriteriaItem: TcxFilterCriteriaItem;
begin
  ACriteriaItem := TcxFilterCriteriaItem(cxGrid1DBTableView1.DataController.Filter.Root.Items[0]);  // Accesses the first criteria item
  AExpression := '[Price] - [Price] * 5%';  //Assigns a new expression
  ACriteriaItem.Expression := AExpression;
  ACriteriaItem.DisplayValue := AExpression;
end;

Note

The Expression property has priority over the Value property.

See Also