Override the method ProcessKeyPreview in your DataGrid.
protected override bool ProcessKeyPreview(ref System.Windows.Forms.Message m)
{
Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode;
if((m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP)
&& keyCode == Keys.Enter )
return false;
return true;
}
Share with