I have a TcxGrid with some columns and data. Columns allow filtering:
I want to remove the "Custom" option from the drop-down filter, but leave all the rest ([All] and auto-suggested). How do I do this?
It's possible to test for what you are looking for in 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;