Skip to main content

TcxEditingControl.OnInitEdit Event

Enables you to customize an in-place cell editor when it is invoked.

Declaration

property OnInitEdit: TcxecInitEditEvent read; write;

Remarks

This event occurs every time an in-place editor is activated.

Use the Sender parameter to access the container control that raised the OnInitEdit event. Cast the Sender parameter value to the corresponding TcxEditingControl class descendant to access the control’s API members.

The AItem parameter provides access to the container control item whose cell is being edited.

The AEdit parameter provides access to the activated in-place cell editor. Cast the parameter value to the corresponding TcxCustomEdit class descendant to access the editor’s API members.

The following code example shows the pop-up window of an in-place drop-down editor every time it is invoked.

procedure TMyForm.tvCustomersInitEdit(Sender, AItem: TObject; AEdit: TcxCustomEdit)
begin
  if AEdit is TcxCustomDropDownEdit then  // Checks if an in-place cell editor is a drop-down editor
    TcxCustomDropDownEdit(AEdit).DroppedDown := True;  // Opens the drop-down editor's pop-up window
end;

Note

To disable an in-place cell editor based on certain conditions, handle the OnEditing event. If you need to change the edit value of an activated editor, handle the OnInitEditValue event instead.

See Also