TcxFilterCriteria.AddExpressionItem(TcxFilterCriteriaItemList,TObject,TcxFilterOperatorKind,string,string) Method
Adds a calculated expression to a filter condition.
Declaration
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