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

TCustomGrid.GetDefaultEditor

Gets the default cell editor for the specified column.

Declaration

Source position: grids.pas line 1102

protected function TCustomGrid.GetDefaultEditor(

  Column: Integer

):TWinControl; virtual;

Arguments

Column

  

Column number examined in the method.

Function result

The control used as the Editor for the specified column number.

Description

GetDefaultEditor is a TWinControl function used to get the default Editor control for the specified column number.

GetDefaultEditor calls EditingAllowed to determine if the column can be edited. When editing is permitted, the Columns collection is used to get the ButtonStyle stored in the TGridColumn instance. If the column uses the cbsAuto button style and has a valid non-empty PickList, the cbsPickList button style is used.

If Columns has not been enabled, the cbsAuto button style is always used for the Editor control.

GetDefaultEditor calls EditorByStyle to create the Editor with the button style needed for the control. The return value is Nil if the column does not allow editing, or the current cell is a fixed column or row header.

For an Editor using the cbsPickList button style, its items and drop-down row count are set using values from the column definition in Columns.

GetDefaultEditor is called from the SelectEditor method prior to selecting the cell and signalling the OnSelectEditor event handler (when assigned). Use the OnSelectEditor event handler to override the Editor style or its configuration.


Version 4.0 Generated 2025-05-03 Home