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

# TCustomGrid.EditorByStyle

Selects a cell Editor control with the specified style.

## Declaration

Source position: grids.pas line 1346

`public function TCustomGrid.EditorByStyle(`
`Style: TColumnButtonStyle`
`):TWinControl; virtual;`

## Arguments

`Style` |  | Editor style which determines the editor control selected in the method.

## Function result

Cell editor for the specified style, or Nil when an editor control is not used for the style.

## Description

EditorByStyle is a TWinControl function used to select the control used as the Editor for a cell using the style in the Style argument.

Style contains a value from the TColumnButtonStyle enumeration, and determines which of the internal pre-allocated editors is used in the return value. Some of the values in Style do not require an editor control, like: cbsNone, cbsCheckboxColumn, and cbsButtonColumn. For these values, the return value is always Nil.

EditorByStyle is called from the GetDefaultEditor method when the grid allows editing (goEditing in Options) and the Column collection has been enabled in the control.

## See also

TCustomGrid.Editor |  | The editor control used to modify the value in the current cell.
TCustomGrid.GetDefaultEditor |  | Gets the default cell editor for the specified column.
TCustomGrid.Columns |  | Definitions for the columns displayed the grid.
TCustomGrid.Options |  | Contains the set of optional features and/or behaviors enabled for the grid control.
TGridColumn.ButtonStyle |  | The style used for a button displayed for cells in the column.
TGridColumn.ReadOnly |  | True if the values in the column cannot be changed at run-time using the cell editor.
TColumnButtonStyle |  | Enumeration with cell editor types available in a grid control.