Reputation: 2795
I developed a Grid Control and I want that when Tab is pressed it jumps from on cell ot another. The issue is that no matters what event I suscribe or I override on the control when tab is pressed it never gets called. I also try to catch the Tab at the Form level but it's the same , any Key events respond to the TAB. Any suggestions?
Upvotes: 1
Views: 3637
Reputation: 980
Have you tried overriding ProcessCmdKey?
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(GridControlFocused)
{
switch(keyData)
{
case Keys.Tab:
// put code here to jump to next cell.
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
Upvotes: 1
Reputation: 437
Either PreviewKeyDown or KeyPress should work for you. Are you sure your GridControl got focus while you tested your code?
Upvotes: 1