New to Telerik UI for WinForms? Download free 30-day trial

Menu Merge

You can merge RadMenuItems by using the MergeMenu method of RadMenu. The parameter designates the source menu and the menu, on which the method is invoked, determines the destination menu.

You need not call this method if you want to use menu merge in a MDI application. RadMenu automatically discovers that it is placed in a child MDI form and it automatically invokes MergeMenu when necessary.

Menu Merge

radMenu1.MergeMenu(srcRadMenu2);

radMenu1.MergeMenu(srcRadMenu2)

RadMenuItem class has two properties that determines the way the items are merged: MergeType and MergeOrder.  

MergeType

MergeType property is of type MenuMerge enumeration members are:

  • Add - the default value. The items are added to the left of the items originally in the parent menu.

  • Replace - the item at the same position in the parent menu is replaced by the item in the child menu.

  • MergeItems- similar to replace but items from the parent and child menus at that position are merged. For example, you can merge the items in the File menu of the parent form with the items of the File menu of the child form. The name of the menu is not important though - it is the match of positions in the parent menu and child menu that is taken in account not their names.

  • Remove - the item is removed when the child form is maximized in a MDI application.

MergeOrder

An integer value which determines the merge order of the items from the source menu. The default value is 0. Acceptable values are greater or equal to 0. The merge order value of each menu item determines the relative position of the menu item according to the values of the other menu items participating in the merge. Higher values are position to the right and lower values to the left.

For instance, if two menu items have MergeType Add and the first one has MergeOrder 150 and the second one 0, the second item will be positioned on the left of the first one since the first one has higher number for MergeOrder.

See Also

In this article