如何从 TcxGrid 列过滤器中删除 "Custom" 过滤器?

How to remove "Custom" filter from TcxGrid column filters?

我有一个包含一些列和数据的 TcxGrid。允许过滤的列:

我想从下拉过滤器中删除 "Custom" 选项,但保留所有其他选项([全部] 和自动建议)。我该怎么做?

可以在 DataController.Filter.OnGetValueList 中测试您要查找的内容:

procedure TForm1.cxGridTableView1DataControllerFilterGetValueList(
  Sender: TcxFilterCriteria; AItemIndex: Integer; AValueList: TcxDataFilterValueList);
var
  i: Integer;
begin
  for i := 0 to AValueList.Count - 1 do
    if AValueList[i].Kind = TcxFilterValueItemKind.fviCustom then
    begin
      AValueList.Delete(i);
      break;
    end;

    //  AValueList[i].Kind is one of
    //  fviAll, fviCustom, fviBlanks, fviNonBlanks, fviUser, fviValue, fviMRU, fviMRUSeparator, fviSpecial, fviUserEx
end;