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.

Customising the editor context menu

Thread ID:

Created:

Updated:

Platform:

Replies:

119179 May 19,2015 05:48 AM May 22,2015 05:02 AM Windows Forms 3
loading
Tags: General
Andrew Le Couteur Bisson
Asked On May 19, 2015 05:48 AM

I wish to remove the File Menu from the EditControl but this doesn't seem possible even though it is suggested in the documentation that it ought to be.
It seems that the FillMenu event only permits the addition of top-level menu items or the removal of all menu items.
How can I create a context menu that is identical to the default one without the File menu or its sub-menus?

Thanks,
Andy

Senthil Kumaran Rajan [Syncfusion]
Replied On May 20, 2015 07:31 AM

Hi Andrew,

Thank you for your update.

We would like to let you know that, the reported requirement can be achieved by handling the MenuFill event in EditControl and using the property named RemoveContextMenuItem from the ContextMenuProvider. Please refer the below code snippet to remove the default menu item from the context menu. We have prepared the sample for your reference and it can be downloaded from the following location.


Code Snippet[C#]:

void editControl1_MenuFill(object sender, EventArgs e)

{

ContextMenuManager cm = (ContextMenuManager)sender;

//To Remove the File menu from the EditControl ContextMenu

cm.ContextMenuProvider.RemoveContextMenuItem("&File");

}


Sample Location : http://www.syncfusion.com/downloads/support/forum/119179/CustomizeContextMenu475227645.zip


Additionally please refer the below KB link to customize the ContextMenu items in EditControl.


KB Link : http://www.syncfusion.com/kb/336/how-do-i-customize-the-context-menu-support-in-the-edit-control


Could you please check with the above solution and let us know whether the provided solution is helpful to achieve your requirement?

Please let us know if you need further assistance.

Regards,
Senthil


Andrew Le Couteur Bisson
Replied On May 21, 2015 07:44 AM

I really have no idea why I couldn't find that :)

Thanks,
Andy

Senthil Kumaran Rajan [Syncfusion]
Replied On May 22, 2015 05:02 AM

Hi Andrew,

Thank you for your update.

Please let us know if you need further assistance.

Regards,
Senthil

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.

;