Skip to main content

TcxFilterCriteriaItemList Class

A list of filter conditions combined by a logical operator.

Declaration

TcxFilterCriteriaItemList = class(
    TcxCustomFilterCriteriaItem
)

Remarks

A filter criteria item list stores a list of filter conditions combined by one logical operator. This list can contain both simple and aggregate filter criteria.

Main API Members

The list below outlines key members of the TcxFilterCriteriaItemList class. These members allow you to manage filter conditions.

AddExpressionItem | AddItem
Add a new simple criterion.
AddItemList
Adds a new aggregate criterion.
BoolOperatorKind
Specifies the logical operator that combines conditions at the current level.
Clear
Clears the filter criteria list.
Count
Returns the number of filter criteria in the list.
Criteria
Provides access to the parent filter criteria manager.
Items
Provides indexed access to all filter criteria in the list.

Code Example

The code example in this section applies the following filter criteria to CustomerCount and Name data grid columns:

  (CustomerCount < 1000) AND ((Name LIKE 'A%') OR (Name LIKE 'Z%'))
var
  ADataController: TcxGridDBDataController;
  AItemList: TcxFilterCriteriaItemList;
begin
  ADataController := cxDBTableView1.DataController;
  ADataController.Filter.BeginUpdate;  // Initiates the following batch data controller change
  try
    ADataController.Filter.Root.Clear;
    ADataController.Filter.Root.AddItem(cxDBTableView1CustomerCount, foLess, 1000, '1000');
    AItemList := ADataController.Filter.Root.AddItemList(fboOr);
    AItemList.AddItem(cxDBTableView1Name, foLike, 'A%', 'A%');
    AItemList.AddItem(cxDBTableView1Name, foLike, 'Z%', 'Z%');
    ADataController.Filter.Active = True;
  finally
    ADataController.Filter.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;

Direct TcxFilterCriteriaItemList Class Reference

The TcxFilterCriteria.Root property references a TcxFilterCriteriaItemList object.

Inheritance

TObject
TcxCustomFilterCriteriaItem
TcxFilterCriteriaItemList
See Also