I was catching the keystrokes with the Windows.Forms.KeyEventHandler. However, in NumericUpdown celltypes, when I recompute the values to be anything other than numeric, an exception occurs. When i change the celltype to static, the values are correctly displayed as they were computed with each keystroke.
Regards
Chak
>If the cell is actively being edited, you can catch keystrokes in CurrentCellControlKeyMessage (it is raised for both KeyUp and KeyDown, so just e.Msg to pick out only one hit. To test what cell you are on, you can check the the type of grid.CurrentCell.Renderer.
>
>
>this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;
>this.gridControl1.CurrentCellControlKeyMessage += new GridCurrentCellControlKeyMessageEventHandler(gridControl1_CurrentCellControlKeyMessage);
>
>
>
>private void grid_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
>{
> Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
> if(e.Msg.Msg == 0x100) //WM_KEYDOWN
> {
> Console.WriteLine("WM_KEYDOWN->" + keyCode.ToString());
> }
> else if(e.Msg.Msg == 0x101) //WM_KEYUP
> {
> Console.WriteLine("WM_KEYUP->" + keyCode.ToString());
> }
>}
>
>
>