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.
Syncfusion Feedback

CurrentCellKeyDown

Thread ID:

Created:

Updated:

Platform:

Replies:

8136 Oct 22,2003 05:12 PM UTC Oct 22,2003 08:46 PM UTC Windows Forms 1
loading
Tags: GridControl
Desis Machino
Asked On October 22, 2003 05:12 PM UTC

Sorry if I am asking a question thats already been asked (but I cannot find an answer). But, when I use a grid control, and create event handlers for for the CurrentCellKeyDown, CurrentCellKeyPress, and CurrentCellKeyUp, and type any keys (other than the arrow keys or backspace), only the CurrentCellKeyPress is called (the KeyUp and KeyDown do not get called as expected). For the the others keys (arrows or backspace), all handlers get called correctly. Is this a bug or do I need to do anything additional within grid control to capture these key events. Thanks, Vikram.

Administrator [Syncfusion]
Replied On October 22, 2003 08:46 PM UTC

You can determine whether CurrentCellKeyUp and CurrentCellKeyDown is called through the CurrentCellControlKeyMessage event. Here is a handler that guarantees controlkey and shiftkey are passed to both CurrentCellKeyDown and CurrentCellKeyUp. You can modify it for the keys you want to catch there.
private void grid_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.ShiftKey || keyCode == Keys.ControlKey)
	{
		e.CallProcessKeyPreview = false;
		e.CallBaseProcessKeyMessage = false;
	}
}

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.

Warning Icon 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.Close Icon

;