Remove Default Context menu

Hi there,
I am using syncfusion 4.402.0.51 and .NET 2.0

I have used edit control in my application to show the content from a file. It shows the file correctly, but i want to remove the default context menus available in the edit control also remove the shortcuts for them, and i need to add my custom menus with my shorcut to the context menu of the edit control.

How do i do that? if possible give me a working example.

4 Replies

JJ Jisha Joy Syncfusion Team September 12, 2007 11:48 AM UTC

Hi Sekar,

By Setting the EditControl.ContextMenuEnabled property to false value does disable the default context menu and the hot keys that get activated are associated with the editcontrol itself. And so if you want to disable the hot keys such as Ctrl +F and etc., you need to remove the corresponding key binding using the EditControl.KeyBinder.RemoveBinding(..) method. Set custom ContextMenu as EditControl ContextMenu. Below is the sample code snippet for your reference:


// Disable the default context menu
this.editControl1.ContextMenuEnabled = false;

//this will remove CtrlF shortcut
this.editControl1.KeyBinder.RemoveBinding(Keys.Control | Keys.F);

// Set custom ContextMenu as EditControl ContextMenu
this.editControl1.ContextMenu = this.contextMenu1;


Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Edit/F68135/main.htm

Please try with the above details and let me know if you have any questions.

Regards,
Jisha


SE Sekar September 12, 2007 01:51 PM UTC

Jisha,

Thanks for your update.
Is there any way that I can remove all the Keybindings from edit control? like this

this.editControl1.KeyBinder.RemoveAllBindings()
So that i need not call for each key associated with that.

Thanks,
Sekar


JJ Jisha Joy Syncfusion Team September 13, 2007 06:12 AM UTC

Hi Sekar,

Thank you for your interest in Syncfusion Essential Studio.

The question you’ve posted has raised some very significant issues, as this might be a Feature Request. We will get back to you within 2 business days with a complete response after due analysis of these issues.

Thank you for your patience.

Regards,
Jisha


JJ Jisha Joy Syncfusion Team September 17, 2007 05:11 AM UTC

Hi Sekar,

Currently we do not provide support to remove all keybindings from EditControl. This has been confirmed as a Feature Request. We will implement this feature in our forthcoming new version releases or service pack releases. We usually have a timeframe of at least three months between releases. The feature implementation would also greatly depend on the factors like product design, code compatibility and complexity. We will get back to you once the feature is implemented.

Thank you for your interest in Syncfusion products.

Regards,
Jisha

Loader.
Up arrow icon