Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomGridTableView.OnEditKeyPress Event

In This Article

Occurs when an alphanumeric key is pressed to change a cell editor‘s value.

#Declaration

Delphi
property OnEditKeyPress: TcxGridEditKeyPressEvent read; write;

#Remarks

This event fires before the OnEditChanged event is generated, and enables you to perform specific actions before an ASCII character that corresponds to the pressed key is passed to a cell editor.

The Sender parameter references the View.

The AItem parameter identifies the grid item whose value is about to be edited.

The AEdit parameter references a cell editor.

The Key parameter specifies the ASCII character of the pressed key. You can replace it with a custom character to remap keys “on the fly”. The following code snippet demonstrates how this can be accomplished for the ‘&‘ (ampersand) key in text editors.

procedure TMyForm.tvEditKeyPress(Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Char);
begin
  if(AEdit is TcxTextEdit) and (Key = '&') then
    Key := '+';
end;
See Also