I'm trying to get when the user presses the enter key when the grid has the focus. There is no editing going on, and I tried specifying EnterKeyBehavior to None, hoping that that would pass the enter through the key down event. But nothing doing. Is there some other property or event that needs to be handled in order to catch this?
CBClay Burch Syncfusion Team September 3, 2002 12:31 PM
Try catching the CurrentCellKeyDown event.
TRTrevor RedfernSeptember 3, 2002 02:49 PM
Well, actually, I am handling that event and not receiving anything. Yes that event seems to work fine when you allow the CurrentCellActivating event to fire. The thing is though I don't want the CurrentCellActivating to fire, so I set the cancel flag to true, but then I can't catch the enter key. Some of the other keys work fine, such as Delete, or any alpha numeric key. These come through loud and clear, but the enter key is lost forever.
> Try catching the CurrentCellKeyDown event.
CBClay Burch Syncfusion Team September 4, 2002 01:35 AM
If there is no currentcell, then I think you will have to subclass your GridControl, and override a method like ProcessCmdKey to catch Enter in this case.
public class MyGridControl : GridControl
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
if(keyData == Keys.Enter)
Console.WriteLine("ProcessCmdKey - Enter");
return base.ProcessCmdKey(ref msg, keyData);