We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

keypress event

hi, i have a grid where i need to do some action when i press ''enter'' in any cell.I can use CurrentCellKeyPress event.but due to some reason, when i press enter, the foccus goes from the current cell to another cell and the CurrentCellKeyPress event is not fired. Is there any other event that i can use ??

1 Reply

AD Administrator Syncfusion Team June 21, 2005 05:25 AM

If you do not want the Enter key to move the currentcell, you can set: this.gridControl1.EnterKeyBehavior = GridDirectionType.None; To catch the Enter key being pressed, you can use the grid.CurrentCellControlKeyMessage event.
private void grid_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.Enter && e.Msg.Msg == 0x100) //WM_KEYDOWN
	{
		Console.WriteLine("WM_KEYDOWN->" + keyCode.ToString());
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon