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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Merge problem with ContextMenuItem in TabbedMdiManager

Thread ID:





55046 Jan 23,2007 12:29 PM UTC Jan 29,2007 08:16 AM UTC WinForms 7
Tags: Tools
Asked On January 23, 2007 12:29 PM UTC

Hi, i'm using a TabbedMdiManager and im trying to replace the exixting contextmenu with one of my own. I'm using this code:

this._TabbedMDIManager.ContextMenuItem.MergeType = MenuMerge.Replace; this._TabbedMDIManager.ContextMenuItem.MergeItems(contextMenuItem);

But it adds my items to the contextmenu instead of removing the existing ones and adding the new ones (i have also tried using MenuMerge.Remove and it works the same).

How can i do this?

Thank you in advance,

Golda Rebecal [Syncfusion]
Replied On January 24, 2007 01:15 PM UTC

Hi Borja,

We can resolve this issue by first disposing the existing menu items in the ContextMenuItem of the TabbedMDIManager and then adding our own ContextMenuItem.



Please see the sample attached and let me know if this helps.

Thanks for your interest in Syncfusion products.



Administrator [Syncfusion]
Replied On January 24, 2007 02:57 PM UTC

Hi Golda,

Your solution works fine in your example, but there are a couple of wrong behaviors in my code (i have been able of reproducing it in the "browse samples" example of TabbedMdi that Syncfusion provides, so you can see in the attached file what is happening).

There are two things:

1.- When i have several tabs the context menu is the original one merged with the new one. If you close al the tabs but one the context menu is the new one.

2.- Even when there is only one tab the context menu contains the new bar items plus "Close" bar item.

I have compared the two examples (the one provided by syncfusion and the one you provide) but i can't tell what the difference is.

Thank you,

Administrator [Syncfusion]
Replied On January 24, 2007 02:59 PM UTC

Here is the attachment :-S


Murugan [Syncfusion]
Replied On January 24, 2007 07:14 PM UTC

Hi Borja,

Thanks for your sample.

Could you please try the following code snippet
this.tabbedMDIManager.ContextMenuItem.BeforePopup += new CancelEventHandler(ContextMenuItem_BeforePopup);

private void ContextMenuItem_BeforePopup(object sender, CancelEventArgs e)



and let me know if it helps you.

Murugan P.S

Administrator [Syncfusion]
Replied On January 25, 2007 08:12 AM UTC

Hi Murugan,

Thanks for your code, but i'm sorre to tell that it neither worked in my code nor in the example from Syncfusion's browse samples.

Any other idea?


Golda Rebecal [Syncfusion]
Replied On January 25, 2007 09:18 AM UTC

Hi Borja,

Could you please try the MergeItems method of the ParentBarItem to merge our menu after disposing the default items.


I have modified the sample you have provided. Please see the attached sample and let me know if this helps.



Administrator [Syncfusion]
Replied On January 29, 2007 08:16 AM UTC

Your solution works fine, thank you.


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