The reason it doesn't work is you are probably trying to get it while it
is in edit mode (a cell is being edited). In that case, the textbox is
getting the key presses, not the data grid.
You will have to find the windows handle of the editor, and hook into
that.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.