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

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

Adds a calculated expression to a filter condition.

#Declaration

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

#Parameters

Name Type
AParent TcxFilterCriteriaItemList
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
AParent A filter criteria list. You can pass nil as the AParent parameter to refer to a root group.
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 root filter criteria list:

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