Datagrid | Capture Key Down event

G

Guest

I have a windows application wherein I have focus on a datagrid. Now when i
hit the down arrow, I want to capture the event. However, my datagrid.KeyDown
event handle is not getting invoked at all.
This is actually the first time I'm ever having to use this event of the
datagrid. Just wanted to know if this does not work?
And if it doesn't, then what's the workaround?

Cheers!
Nick
 
D

Daniel Junges

Hi Nick,
follow the sample below

DataGridTextBoxColumn dataCtrl =
(DataGridTextBoxColumn)dataGrid.TableStyles[member].GridColumnStyles["fieldName"];
TextBox tBox = dataCtrl.TextBox;
tBox.KeyUp += new EventHandler(onKeyUp);

regards
Daniel Junges
 

Ask a Question

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.

Ask a Question

Top