This is a migrated thread and some comments may be shown as answers.

how to prevent merging the ParentMDI menu with ChildMDI menu ???

1 Answer 64 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Asa'ad
Top achievements
Rank 1
Asa'ad asked on 01 Jun 2011, 01:57 PM
i'm using MDI from with RadMenu, if i maximize the child from, it's RadMenu will merge with MDI RadMenu.
How to prevent that ?

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 06 Jun 2011, 08:14 AM
Hi Asa'ad,

Thank you for your question.

This should be done by setting the AllowMerge property to false, but it seems that it currently does not work. This issue will be addressed in some of the next releases. I have added this to PITS so you can track its progress. Here you can find the PITS Issue: Public URL

For the time being, you can prevent the menu merge by overriding the RadMenu class as it is shown in the following code snippet:
public class NonMergeMenu : RadMenu
{
    public bool CancelVisible = false;
 
    public override void MergeMenu(RadMenu sourceMenu)
    {
        NonMergeMenu src = sourceMenu as NonMergeMenu;
 
        base.MergeMenu(sourceMenu);
        base.UnmergeMenu(sourceMenu);
        sourceMenu.Visible = true;
 
        if (src != null)
        {
            src.CancelVisible = true;
        }
    }
 
    protected override void OnVisibleChanged(EventArgs e)
    {
        base.OnVisibleChanged(e);
        if (this.CancelVisible)
        {
            this.CancelVisible = false;
            this.Visible = true;
        }
    }
 
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadMenu).FullName;
        }
        set
        {
            base.ThemeClassName = value;
        }
    }
}

Then you should replace all your RadMenu instances with NonMergeMenu ones.

Your Telerik points have been updated for bringing this issue to our attention.

I hope this helps. Feel free to ask if you have any further questions.

Greetings,
Ivan Todorov
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
Menu
Asked by
Asa'ad
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or