I need to receive the key press events during cell editing in DataGridView control.
From what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily.
I found this piece of code that traps those events for DataGrid control, but that does not work for DataGridView.
Finally figured out. There are two parts of this puzzle – getting keys from cell editing control and getting keys from the DataGridView itself. Here’s my code. To use it, you just need to subscribe to the custom event: keyPressHook.