Skip to main content

Example: Using the foEqual Filter Operator

To create a simple filter condition with the foEqual operator, you can use the AddItem method of the data controller’s Filter object. In the following example, a filter condition is applied to the cxGrid1DBTableView1ID column of the cxGrid1DBTableView1 view. This selects records with the ID field equal to 101:

var
  ID: Integer;
  Str: string;
//...
  ID := 101;
  Str := IntToStr(ID);
  cxGrid1DBTableView1.DataController.Filter.AddItem(nil, 
    cxGrid1DBTableView1ID, foEqual, ID, Str);