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

Standard Key Handlers?

Thread ID:





21936 Nov 29,2004 07:10 PM UTC Nov 30,2004 07:47 PM UTC WinForms 2
Tags: GridControl
Jens Lippmann
Asked On November 29, 2004 07:10 PM UTC

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 10:13 PM UTC

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;

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

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon