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

Problem with RadTreeViewContextMenu in build 2008.1.619

2 Answers 57 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jaimin
Top achievements
Rank 1
Jaimin asked on 23 Jul 2008, 06:42 AM
Hi Telerik,

There is a lit bit problem with the build 2008.1.619 in case of RadTreeViewContextMenu... Here is a sample code:

RadMenuItem rmi1 = new RadMenuItem("1");
rmi1.Value = "1";
RadMenuItem rmi2 = new RadMenuItem("2");
rmi2.Value = "2";
RadMenuItem rmi3 = new RadMenuItem("3");
rmi3.Value = "3";

RadTreeViewContextMenu rtvcm1 = new RadTreeViewContextMenu();
rtvcm1.ID = "rtvcm1";
rtvcm1.Items.Add(rmi1);
rtvcm1.Items.Add(rmi2);

RadTreeViewContextMenu rtvcm2 = new RadTreeViewContextMenu();
rtvcm2.ID = "rtvcm2";
rtvcm2.Items.Add(rmi2);
rtvcm2.Items.Add(rmi3);

RadTreeNode rtn1 = new RadTreeNode("node1", "node1");
rtn1.ContextMenuID = rtvcm1.ID;

RadTreeNode rtn2 = new RadTreeNode("node2", "node2");
rtn2.ContextMenuID = rtvcm2.ID;

RadTreeView rtv1 = new RadTreeView();
rtv1.Nodes.Add(rtn1);
rtv1.Nodes.Add(rtn2);

rtv1.ContextMenus.Add(rtvcm1);
rtv1.ContextMenus.Add(rtvcm2);

Now when you will add this tree view then you will not be seeing menu whose text is "2" because it is added in both the context menus. If you add only menu whose text is "3" in second context menu then all the menu items will be seen.

Can you please rectify this problem...

Thanks and Regards,
Jaimin Kansara

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Jul 2008, 07:19 AM
Hi Jaimin,

This is by design. You should instantiate a new menu item for every context menu you have.

All the best,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jaimin
Top achievements
Rank 1
answered on 24 Jul 2008, 11:22 AM
Hi,

What if I want to have same text and same functionality for all the menu items then why should i create different menu items for all the context menus...

This functionality was supported in your 2007 product which was good but now you changed it so didn't liked the idea so I shared. Hope you can understand and consider the point.

Thanks and Regards,
Jaimin
Tags
TreeView
Asked by
Jaimin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jaimin
Top achievements
Rank 1
Share this question
or