Question

I have a form where I have a series of buttons that the user can click to filter records i a cxGrid This is working OK but I would like to filter without showing the actual filterbar. Is that possible in any way? - I haven't been able to figure out how. I have a button with an * to reset the filter so I don't need the filterbar

procedure TfrmJsCompanies.ButtonClick(Sender: TObject);
var
  ButtonValue: char;
  FilterString: string;
begin
  ButtonValue := (Sender as TcxButton).Caption[1];
  FilterString := ButtonValue + '%';
  with cxDbView1.DataController.Filter.Root do
    begin
      Clear;
      BoolOperatorKind := fboOr;
      AddItem(colCompany_Name, foLike, FilterString, FilterString);
    end;
  cxDbView1.DataController.Filter.Active := True;
  ActiveControl := grdCompanies;
end;
Was it helpful?

Solution

On the TcxGridTableView set the FilterRow.Visible property to False. This will hide the filter bar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top