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

Customising the editor context menu

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

3 Replies

SK Senthil Kumaran Rajan Syncfusion Team May 20, 2015 11:31 AM UTC

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



AL Andrew Le Couteur Bisson May 21, 2015 11:44 AM UTC

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

Thanks,
Andy


SK Senthil Kumaran Rajan Syncfusion Team May 22, 2015 09:02 AM UTC

Hi Andrew,

Thank you for your update.

Please let us know if you need further assistance.

Regards,
Senthil

Loader.
Up arrow icon