TcxFilterCriteriaItemList.AddExpressionItem(TObject,TcxFilterOperatorKind,string,string) Method
In This Article
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 |
---|---|
AItem |
TObject |
AOperator |
Tcx |
AExpression | string |
ADisplay |
string |
#Returns
Type |
---|
Tcx |
#Remarks
Call this function to apply a calculated expression as a filter criterion. The table below lists the function’s parameters:
Parameter | Description |
---|---|
AItem |
An item to which a data controller applies a filter. |
AOperator |
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