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

# TCustomGrid.EditorKeyPress

Implements the OnKeyPress event handler for the cell editor.

## Declaration

Source position: grids.pas line 1348

`public procedure TCustomGrid.EditorKeyPress(`
`Sender: TObject;`
`var Key: Char`
`);`

## Arguments

`Sender` |  | Object (TCustomGrid) for the event notification.
`Key` |  | Key press examined in the method.

## Description

EditorKeyPress is assigned as the OnKeyPress event handler when in the Editor control when it is configured and stored in the Editor property. EditorKeyPress calls the KeyPress method to apply the value in Key to the grid control.

A value not handled in KeyPress is checked for a control or UTF-8-encoded character value. When found, the following actions are performed:

^M (Enter or Shift+Enter)
  Moves to the next (or previous) cell in the AutoAdvance direction, and Resets the Editor control. Key is set to #0.
UTF-8-encoded characters
  Calls EditorCanAcceptKey and EditorIsReadOnly. If Key cannot be handled, it is set to #0. Otherwise, it is retained and passed as an editor key press.