Skip to main content

TcxFilterCriteria.Root Property

Provides access to the root list of filter criteria combined by logical operators.

Declaration

property Root: TcxFilterCriteriaItemList read;

Property Value

Type Description
TcxFilterCriteriaItemList

The list of root filter criteria.

Remarks

Filter criteria can consist of simple and aggregate filter criteria. The Root property provides access to all root-level criteria connected by logical operators.

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;
See Also