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
close icon

Del Shortcut in popup menu firing during grid edit

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

5 Replies

AD Administrator Syncfusion Team 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);

SH Sue Harris 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

SH Sue Harris 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

AD Administrator Syncfusion Team 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.

SH Sue Harris 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

Live Chat Icon For mobile
Up arrow icon