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

Shared RadItemCollection

2 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
Growls
Top achievements
Rank 1
Growls asked on 16 Jan 2017, 03:34 AM

Hi Telerik, is there a way to share a list of RadMenuItems over multiple menus? I would like a list of options for a selection in a treeview (left click) as well as the same options in a right click context menu on the tree.

I have setup the radmenuitems in the context menu, however if I clone those items and place them in the RadMenu, they disappear from the context menu and only appear in the radmenu.

radMenu1.Items.AddRange((RadItem[])radContextMenuBLTree.Items.ToArray().Clone());

The items are only RadMenuItems, and RadMenuSeparatorItems, and RadMenuHeaderItems.

 

2 Answers, 1 is accepted

Sort by
0
Growls
Top achievements
Rank 1
answered on 16 Jan 2017, 03:39 AM
Also the items in the radmenu, after moving them, appear to not wrap. What I mean is that some lines have two menu items on them, I would expect (and want) them to appear one on each line.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jan 2017, 01:07 PM
Hello Craig,

Thank you for writing.  

One RadMenuItem instance can be added to only one Items collection. Thus, the menu item's parent is specified. If you need to have identical menu options in the context menu and the RadMenu on the form, for example, it is necessary to create two separate RadMenuItems. However, you can subscribe the Click event to one and the same even handler. 

Additional information for RadTreeView's context menu is available in the following section in the online documentation:  http://docs.telerik.com/devtools/winforms/treeview/context-menus/default-context-menu

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Growls
Top achievements
Rank 1
Answers by
Growls
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or