Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

Adds a calculated expression to a filter condition.

#Declaration

Delphi
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