Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxFilterCriteriaItemList.AddItemList(TcxFilterBoolOperatorKind) Method

Adds a new aggregate condition to the filter criteria list.

#Declaration

Delphi
function AddItemList(ABoolOperatorKind: TcxFilterBoolOperatorKind): TcxFilterCriteriaItemList;

#Parameters

Name Type Description
ABoolOperatorKind TcxFilterBoolOperatorKind

The Boolean operator that joins the created aggregated condition with existing criteria.

#Returns

Type Description
TcxFilterCriteriaItemList

The created aggregate condition.

#Remarks

Call the AddItemList function to create a new aggregate condition.

#Code Example: Apply Custom Filter Criteria to Grid Columns

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