Skip to main content

TcxFilterCriteriaItemList.AddExpressionItem(TObject,TcxFilterOperatorKind,string,string) Method

Adds a calculated expression to a filter condition.

Declaration

function AddExpressionItem(AItemLink: TObject; AOperatorKind: TcxFilterOperatorKind; const AExpression: string; const ADisplayValue: string): TcxFilterCriteriaItem; overload;

Parameters

Name Type
AItemLink TObject
AOperatorKind TcxFilterOperatorKind
AExpression string
ADisplayValue string

Returns

Type
TcxFilterCriteriaItem

Remarks

Call this function to apply a calculated expression as a filter criterion. The table below lists the function’s parameters:

Parameter Description
AItemLink An item to which a data controller applies a filter.
AOperatorKind A filter condition operator.
AExpression A calculated expression.

The code example below shows how to add a new filter condition to a filter criteria list:

var
  AExpression: string;
  ACriteriaList: TcxFilterCriteriaItemList;
begin
  ACriteriaList := cxGrid1DBTableView1.DataController.Filter.Root;
  AExpression := '[Price] - [Price] * 5%';
  ACriteriaList.AddExpressionItem(cxGrid1DBTableView1HotPrice, foEqual, AExpression, AExpression);
end;
See Also