Contents - Index - Previous - Next


OnGetEditControl event



Applies to
TProfGrid component

Declaration
property OnGetEditControl: TProfGridGetEditControlEvent;

Description

Occurs every time the grid switches to edit mode.

The event asks if the application wants to provide an external control to be used as custom inplace editor instead of the built-in inplace editor.

To use the event, place the desired invisible control on the form and notify the grid about that in the OnGetEditControl event. All the rest necessary processing will be done automatically.


Example

The following event handler assigns some custom inplace editors depending on the column number.

procedure TForm1.ProfGrid1GetEditControl(Sender: TProfGrid; ACol,
  ARow: Integer; var AControl: TWinControl);
begin
  case ACol of
    1: AControl := ComboBox1;
    2: AControl := DateTimePicker1;
    3: AControl := MaskEdit1;
    4: AControl := SpinEdit1
  end
end;