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.
Unfortunately, activation email could not send to your email. Please try again.

keypress event

Thread ID:

Created:

Updated:

Platform:

Replies:

30610 Jun 21,2005 05:02 AM Jun 21,2005 06:25 AM Windows Forms 1
loading
Tags: GridControl
Majesh Peedikakandy
Asked On June 21, 2005 05:02 AM

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 ??

Administrator [Syncfusion]
Replied On June 21, 2005 06: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());
	}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;