Skip to main content

TcxCustomGridTableView.OnFilterControlDialogShow Event

Allows you to respond to a filter customization dialog display operation and modify the dialog’s appearance.

Declaration

property OnFilterControlDialogShow: TNotifyEvent read; write;

Remarks

You can handle the OnFilterControlDialogShow event to modify the Filter Builder dialog when it is displayed.

Event Occurrence

The OnFilterControlDialogShow event occurs every time the Filter Builder dialog is displayed. You can click the Customize… button in the filter panel or call the Filtering.RunCustomizeDialog procedure to display the filter customization dialog.

Event Parameter

Only the Sender parameter is available within an OnFilterControlDialogShow event handler. This parameter provides access to the filter customization form that raised the event.

To access all UI elements on the dialog form, cast the Sender parameter to the TfmFilterControlDialog class (declared in the cxFilterControlDialog unit) as demonstrated in the following code example: Modify Filter Builder Dialog Appearance.

Code Example: Modify Filter Builder Dialog Appearance

The code example in this section changes the built-in Filter Builder dialog when it is displayed.

VCL Data Grid: A Built-in Filter Builder Dialog Example

The following OnFilterControlDialogShow event handler changes the dialog caption, renames Open… and Save As… buttons, and hides level lines in the built-in filter control:

uses
  cxGrid,  // Declares the TcxGrid class
  cxGridDBTableView,  // Declares the TcxGridDBTableView class
  cxFilterControlDialog; // Declares the TfmFilterControlDialog class
// ...

procedure TMyForm.cxGrid1DBTableView1FilterControlDialogShow(Sender: TObject);
begin
  (Sender as TfmFilterControlDialog).FilterControl.ShowLevelLines := False;
  (Sender as TfmFilterControlDialog).btOpen.Caption := 'Open Filter';
  (Sender as TfmFilterControlDialog).btSave.Visible := 'Save Filter';
  (Sender as TfmFilterControlDialog).Caption := 'Configure Filter Criteria';
end;

VCL Data Grid: A Built-in Filter Builder Dialog Example

Limitations and Considerations

While you can modify the dialog form layout in an OnFilterControlDialogShow event handler (hide built-in UI elements, for example), a subsequent form redraw operation restores the default layout.

See Also