[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ValEdit' (#lcl)

# TValueListEditor.GetDefaultEditor

Gets the editor control for the specified column number.

## Declaration

Source position: valedit.pas line 163

`protected function TValueListEditor.GetDefaultEditor(`
`Column: Integer`
`):TWinControl; override;`

## Arguments

`Column` |  | Column number for the editor control.

## Function result

Editor control for the specified column number.

## Description

GetDefaultEditor is a TWinControl function used to get the editor control for the specified column number. The return value is the TWinControl used as the editor for the cell in the specified column number.

GetDefaultEditor saves the current contents in Cells for the selected Row number to allow use of RestoreCurrentRow. GetDefaultEditor calls the inherited method to enable the logic implemented in the ancestor class.

KeyOptions is used to determine if the VK_Delete key needs to be be handled in the editor control. EditorOptions is updated to include or exclude the value EO_HOOKKEYDOWN based on the presence of KeyDelete in KeyOptions.

When Column contains 1 (the Value column), the item definition in ItemProps is used to configure the default editor. Its EditStyle is applied by calling the EditorByStyle method. For a PickList-style editor, pick list values in the item definition are assigned to the combo-box editor control and its drop-down row count is set to the value in DropDownRows. The OnGetPickList event handler is signalled (when assigned) to get user-defined values in the editor control. The read-only status for the editor is updated to reflect the value in the item definition.

When Column contains 0 (the Key column), the editor is marked as read-only when KeyOptions does not include the value KeyEdit.

## See also

TValueListEditor.KeyOptions |  | Controls actions that can be performed for Keys in the control.
TValueListEditor.ItemProps |  | Provides indexed access to item definitions in the control.
TValueListEditor.OnGetPickList |  | Event handler signalled to load values for the PickList in an item.
TItemProp.EditStyle |  | Identifies the type of editor used for the item value.
TItemProp.ReadOnly |  | Indicates if the value for the item can be changed.
TCustomGrid.EditorOptions |  | The option flags sent to the Editor control in the grid.