Skip to main content

Example: TcxFilterCriteria.UnderscoreWildcard

The next example demonstrates how to add a filter condition to limit values. Only values that consist of exactly four characters and contain the ‘an’ sub-string in the middle of the word are accepted. The first and last letters are undefined. Words that have any symbols in these positions and contain the ‘an’ substring are selected by this criterion. The UnderscoreWildcard property is set to ‘?’ for demonstrative purposes only.

FDataController.Filter.UnderscoreWildcard := '?';
  FDataController.Filter.BeginUpdate;
  try
    FDataController.Filter.Root.Clear;
    FDataController.Filter.Root.AddItem(DBTableView1Customer, foLike,
      '?an?', '.an.');
  finally
    FDataController.Filter.EndUpdate;
  end;