Skip to main content

TcxGridEditingController.ShowEdit(TcxCustomGridTableItem,TShiftState,Integer,Integer) Method

Opens an editor for a specific item.

Declaration

procedure ShowEdit(AItem: TcxCustomGridTableItem; Shift: TShiftState; X: Integer; Y: Integer); reintroduce; overload;

Parameters

Name Type
AItem TcxCustomGridTableItem
Shift TShiftState
X Integer
Y Integer

Remarks

Call the ShowEdit method to open an editor for the item specified by the AItem parameter. ShowEdit opens an editor within the focused record provided that no other cell is being edited at the moment.

A cell editor can be activated in several ways:

  • A user focuses a cell and presses the Enter key. The editor is opened and its contents are selected.

  • A user focuses a cell and presses any other key. The editor is opened while replacing cell contents with this key.

  • If the View’s OptionsView.ShowEditButtons property is set to gsebForFocusedRecord, the editor will be opened immediately after clicking any cell in the currently focused record. If this property is set to gsebAlways, clicking any cell within the View will immediately activate the editor. This can be useful, for instance, if a cell is assigned an editor with buttons (dropdown editors). Clicking the button within the cell will activate the editor and open the dropdown window.

The three overloaded variants of the ShowEdit method enable you to simulate these methods of activating a cell editor.

The first overloaded method opens an editor for a given item within the focused record. If AItem is nil, the editor is opened for the currently focused item.

The second overloaded method opens an editor for a given item within the focused record and passes it the key specified by the Key parameter.

The third overloaded method opens an editor for a specific item within the focused record. This method is called internally when a user clicks a cell within a View. The state of mouse buttons is defined by the Shift parameter. X and Y identify the coordinates of the mouse relative to the top left corner of a grid View.

See Also