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

Merging Menu

3 Answers 148 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Emre Ozan Alkan
Top achievements
Rank 2
Emre Ozan Alkan asked on 08 Sep 2009, 01:10 PM
I have problem with menu merge feature. I have RadForm named "MainForm" whose IsMdiContainer = true. I add  RadMenu to that form.I add menu items to that rad menu. There are; "File | Edit | View | List | Reports | Tools | Administration | Help" . At the begining all their properties about merging is default : MergeIndex = -1, MergeOrder = 0, MergeType = Add.

I have RadForm named "Person". This form also have RadMenu. I add menu item to that rad menu.It has just "User" menu. Again this item's properties are default : MergeIndex = -1, MergeOrder = 0, MergeType = Add.

When I click File > Create New User  from MDI form's menu, I create child form by these lines :
            var Person = new Person();
            Person.MdiParent = this;
            Person.Show();

Now I have MDI form with child form. When I maximize the child form, its "Users" menu, added to MDI's menu, yeah this is expected.
And MDI's menu become "File | Edit | View | List | Reports | Tools | Administration | Help | User".

What I want to do is, adding that "User" menu to MDI's form in another order.Which should be;
"File | Edit | View | User | List | Reports | Tools | Administration | Help" instead of "User" menu added as to the last.

Or at least I can add empty "User" menu item to the MDI form's menu, where after "Person" form is maximized, "Person" forms sub items merge with the empty one in MDI form.

I play a lot with the Merge Order and Merge Index properties to achive but I was't able to do that.

The only thing that I can do is;
if I have menu like
| Menu1 | Menu2 | Menu3 | Menu4 |  and
| dump1 | dump2 | dump3 | dump4 |

I can use merge feature with only the menus acrossing. I can use MergeType's "Replace", "Merge Items" properties with only
for menu1 and dump1 , or menu2 and dump2 where their physical order should match. Otherwise menu just added to last place.

Can someone send example code or helpful examples ?  about merging feature.

3 Answers, 1 is accepted

Sort by
0
Emre Ozan Alkan
Top achievements
Rank 2
answered on 09 Sep 2009, 07:18 AM
Also I'm gettin error while doing that =>

I create a rad form with mdi container property. Add rad menu, then put 3 menu and their merge type property is "Add".

I create a rad form and add rad menu, then put 4 menu where their merge type property is "MergeItems".

I create this rad form as child in mdi container, if I maximize the child form, I get this error =>

Form5
Unhandled exceptoion has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Index was outside the bounds of the array.
Details :
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Telerik.WinControls.UI.RadMenu.MergeMenu(RadMenu sourceMenu)
   at Telerik.WinControls.UI.NativeWindowListener.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DefMDIChildProc(IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.Form.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmWindowPosChanged(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at Telerik.WinControls.UI.RadFormControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.HostingProcess.Utilities
    Assembly Version: 9.0.0.0
    Win32 Version: 9.0.21022.8
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.HostingProcess.Utilities/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.HostingProcess.Utilities.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualStudio.HostingProcess.Utilities.Sync
    Assembly Version: 9.0.0.0
    Win32 Version: 9.0.21022.8
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.HostingProcess.Utilities.Sync/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll
----------------------------------------
Microsoft.VisualStudio.Debugger.Runtime
    Assembly Version: 9.0.0.0
    Win32 Version: 9.0.21022.8
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Debugger.Runtime/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Debugger.Runtime.dll
----------------------------------------
vshost
    Assembly Version: 9.0.0.0
    Win32 Version: 9.0.21022.8
    CodeBase: file:///C:/Documents%20and%20Settings/EmreAlkan/Desktop/UITest1/UITest/bin/Debug/UITest.vshost.exe
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Deployment
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Telerik.WinControls
    Assembly Version: 2009.2.9.701
    Win32 Version: 2009.2.9.701
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls/2009.2.9.701__5bb2a467cbec794e/Telerik.WinControls.dll
----------------------------------------
Telerik.WinControls.Docking
    Assembly Version: 2009.2.9.701
    Win32 Version: 2009.2.9.701
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.Docking/2009.2.9.701__5bb2a467cbec794e/Telerik.WinControls.Docking.dll
----------------------------------------
Telerik.WinControls.RadDock
    Assembly Version: 2009.2.9.701
    Win32 Version: 2009.2.9.701
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.RadDock/2009.2.9.701__5bb2a467cbec794e/Telerik.WinControls.RadDock.dll
----------------------------------------
Telerik.WinControls.UI
    Assembly Version: 2009.2.9.701
    Win32 Version: 2009.2.9.701
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.UI/2009.2.9.701__5bb2a467cbec794e/Telerik.WinControls.UI.dll
----------------------------------------
TelerikCommon
    Assembly Version: 2009.2.9.701
    Win32 Version: 2009.2.9.701
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/TelerikCommon/2009.2.9.701__5bb2a467cbec794e/TelerikCommon.dll
----------------------------------------
UITest
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/EmreAlkan/Desktop/UITest1/UITest/bin/Debug/UITest.EXE
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



0
Emre Ozan Alkan
Top achievements
Rank 2
answered on 09 Sep 2009, 11:47 AM
Nobody out there and have any code snippets or example projects to send or show me ? I need some help friends about menu merging.
0
Nick
Telerik team
answered on 09 Sep 2009, 02:06 PM
Hi Emre Ozan Alkan,

Please download the latest internal build (2009.2.9.903) from your Telerik account about the second issue. We modified substantially the code about menu merge. Thank you very much for your time.

About your first question, please see this help topic. We followed this specification when implementing Menu Merge. Items can replace other items only if they share the same position (name is not relevant).

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Menu
Asked by
Emre Ozan Alkan
Top achievements
Rank 2
Answers by
Emre Ozan Alkan
Top achievements
Rank 2
Nick
Telerik team
Share this question
or