TCustomGrid.KeyDown is not called when editor is shown and user presses e.g. VK_DELETE
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
When you are editing a cell in a grid, TCustomGrid.KeyDown is not called when user presses Delete, Left, Right or Backspace (and possibly other keys).
Common parctice for editors is that user can intercept any key the user presses in the control if an OnKeyDown event for it exists.
Steps to reproduce:
Build and run attached sample project.
Click on any cell and start editing it.
If you press a writable character or Insert, Up, Down or any function key etc. then OnKeyDown is fired.
If you press Delete, Backspace or Left/Right then OnKeyPress is not fired.
(If the text in the cell is selected, then Left/Right will fire KeyDown).
Additional information:
It may have to do with the fact that by default EO_HOOKKEYDOWN is not included in
TStringCellEditor.msg_SetGrid, TButtonCellEditor.msg_SetGrid and TPickListCellEditor.msg_SetGrid.
A workaround is to set EditorOptions when the user selects a cell (which I have currently done for TValueListEditor in GetDefaultEditor).
Mantis conversion info:
- Mantis ID: 23983
- Build: r40460
- Version: 1.1 (SVN)