Skip to main content

Example: Using the foInList Filter Operator

In this example, the foInList filter operator is applied to the cxGrid1DBTableView1ID column. The operator allows you to select records by testing the membership of a field value within a specific list (array of variants). The value list is created by the VarArrayCreate function.

var
  V: Variant;
const
  ID1 = 1; ID2 = 2; ID3 = 3;
//...
  V := VarArrayCreate([0, 2], varVariant);
  V[0] := ID1;
  V[1] := ID2;
  V[2] := ID3;
  cxGrid1DBTableView1.DataController.Filter.AddItem(nil, cxGrid1DBTableView1ID, foInList, V, '(1, 2, 3)');