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.

Standard Key Handlers?

Thread ID:

Created:

Updated:

Platform:

Replies:

21936 Nov 29,2004 02:10 PM Nov 30,2004 02:47 PM Windows Forms 2
loading
Tags: GridControl
Jens Lippmann
Asked On November 29, 2004 02:10 PM

Does the grid have already built-in handlers for common hot keys (CTRL-C,X,V,A, etc.) that can be turned on with one of the many "magic" properties or do I need to override OnKeyPress, and handle the key press event, respectively? If there is no such "magic" it would be a nice feature to have all common handlers available esp. since there is already a clip board handler class. Regards, Jens

Administrator [Syncfusion]
Replied On November 29, 2004 05:13 PM

The grid has support for copy, cut and paste throught ctl+C, ctl+X and ctl+V. It does not support ctl+A. To handle other keys, you could use this event, but you would need to check e.Msg.Msg as the event is raised for both KeyUp and KeyDown.
private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
	if( 0 != (keyCode & Keys.ShiftKey) || 0 != (keyCode & Keys.ControlKey))
	{
		e.CallProcessKeyPreview = false;
		e.CallBaseProcessKeyMessage = false;
		Console.WriteLine(e.Msg.ToString());
		Console.WriteLine(keyCode.ToString());
	}
}

Administrator [Syncfusion]
Replied On November 30, 2004 02:47 PM

Great that works well. Even pastes correctly into an Excel spreadsheet. Now it would be nice to also support ctrl+A cuz then I wouldn''t have to do anything :) Thanks for your help. Jens

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.

;