keydown not firing

I've got a GridGroupingControl as the base class of a control. No matter how hard I press the keys on my keyboard, KeyDown is never fired. I've also overridden OnKeyDown, that never fires either. All I'm doing is selecting cells with the mouse to make sure it has focus and then pressing random keys.

Any ideas?

2 Replies

IB ian bradley May 30, 2012 04:35 PM UTC

I'll leave it 10 minutes before posting next time. There's also a GridControlKeyDown event on the grid grouping control. That does fire when I click in the cells. 


RB Ragamathulla B Syncfusion Team June 7, 2012 03:37 AM UTC

Hi Ian,

Thanks for the update.

The ProcessCmdKey override event is fired when key is activated. Please refer to the code which is explains the same.

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            int clipboardFlags = GridDragDropFlags.Text | GridDragDropFlags.Styles | GridDragDropFlags.Compose;
            Keys keyCode = keyData & Keys.KeyCode;
            bool controlKeyDown = (Control.ModifierKeys & Keys.Control) != Keys.None;
            if (controlKeyDown && (keyCode == Keys.V))//|| keyCode == Keys.C || keyCode == Keys.X))
            {
               //code
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

Let me know if you have any further concerns.

Regards,

Ragamathullah B.


Loader.
Up arrow icon