tags:

views:

192

answers:

4

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?

A: 

Set Form.KeyPreview = false.

CesarGon
This has no effect on Tab key
yu_sha
A: 

Either PreviewKeyDown or KeyPress should work for you. Are you sure your GridControl got focus while you tested your code?

PerlDev
PreviewKeyDown ... I'm not working with WPF...
jmayor
+1  A: 

Have you tried to override IsInputKey?

danbystrom
A: 

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);
}
JohnForDummies