Skip to main content

TcxCustomGridTableViewData.AddItemToFilter(TcxFilterCriteriaItemList,TcxCustomGridTableItem,TcxFilterOperatorKind,Variant,string,Boolean) Method

Adds a filter condition to a list of filter conditions.

Declaration

function AddItemToFilter(AParent: TcxFilterCriteriaItemList; AItem: TcxCustomGridTableItem; AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; ADisplayText: string = ''; AReplaceExistent: Boolean = True): TcxFilterCriteriaItem;

Parameters

Name Type
AParent TcxFilterCriteriaItemList
AItem TcxCustomGridTableItem
AOperatorKind TcxFilterOperatorKind
AValue Variant
ADisplayText string
AReplaceExistent Boolean

Returns

Type
TcxFilterCriteriaItem

Remarks

The added filter condition can be used to filter values of AItem.

The AParent parameter specifies a list of criteria in the filter dropdown that the AValue filter condition is added to. Note: to add a new filter condition to the root filter list (see the Filter.Root property), set the AParent parameter to nil. The data is selected against filter items combined by a logical operator (if two or more of them are present). To specify a logical operator, use the View’s DataController.Filter.Root.BoolOperatorKind property;

The AItem parameter specifies the item (a column or a row) whose values are to be filtered;

The AOperatorKind parameter specifies the type of relational operator (see the TcxFilterCriteriaItem.OperatorKind property);

The AValue parameter specifies the filter condition to be added to the list (see the TcxFilterCriteriaItem.Value property);

The ADisplayText parameter specifies the display text of the AValue filter condition in the filter status bar (see the TcxFilterCriteriaItem.DisplayValue property);

The AReplaceExistent parameter specifies whether to clear AParent before a new criterion is added. Set the AReplaceExistent to True to remove existing filter items. Otherwise, a new filter item will be added to the existing list.

The AddItemToFilter method returns a reference to the added filter item.

See Also