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

Del Shortcut in popup menu firing during grid edit

Thread ID:





22289 Dec 8,2004 11:19 PM UTC Dec 10,2004 01:36 AM UTC WinForms 5
Tags: GridControl
Sue Harris
Asked On December 8, 2004 11:19 PM UTC

Hi, I''ve got a popup menu defined with a delete bar item which has the shortcut set to Shortcut.Del Unfortunately the click event for this bar item is firing when I hit the delete key while editing text in a cell in the grid (which is not at all desirable). How can I prevent this from occuring? Thanks, Sue

Administrator [Syncfusion]
Replied On December 9, 2004 07:44 AM UTC

The only way I know to do this is to derive the grid and override ProcessCmdKey.
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
	if(keyData == Keys.Delete)
		return false;
	return base.ProcessCmdKey (ref msg, keyData);

Sue Harris
Replied On December 9, 2004 07:18 PM UTC

Is there any way in that override class to determine whether the grid has a Syncfusion XP context menu? Thanks, Sue

Sue Harris
Replied On December 9, 2004 08:54 PM UTC

Hi Clay, Unfortunately the ProcessCmdKey doesn''t seem to trigger in the instance of the popup menu shortcut firing when editing. It only triggers in the reverse situation (when I''m not editing), so apparently its firing on the cell controls ProcessCmdKey (which I doubt I can override them all). Do you have any further ideas? Thanks, Sue

Administrator [Syncfusion]
Replied On December 9, 2004 11:32 PM UTC

I tried it with a main menu item, and that worked OK for me. I did not try it with a ContextMenu. Can you post a sample showing what you are doing? As far as knowing what kind of menu is being used, are you usingteh grid.ContextMenu property? if so, you could text the typpe of that obejct.

Sue Harris
Replied On December 10, 2004 01:36 AM UTC

My apologies, I missed the piece of code in my base class that set the context menu of the renderer to the grids context menu. Commenting that line out fixed the problem. Thanks, Sue


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