Hi!
I have a problem applying a RadContextMenu to different nodes in the TreeView.
Specific items in my tree need to have a context menu, others should ignore right-click on them.
Each node that should have a menu should be able to have its own menu, dynamically created.
For purposes of this example, each menu will have only a single item, some random number.
There is a method like this:
For each node that needs to have a menu, I am calling createContextMenu(node);
However, what happens is that the child nodes of such nodes are using the same context menu. I don't want the child nodes to have a context menu at all - in other words - I want to have a context menu only for nodes that I explicitely set.
How can this be achieved?
I have a problem applying a RadContextMenu to different nodes in the TreeView.
Specific items in my tree need to have a context menu, others should ignore right-click on them.
Each node that should have a menu should be able to have its own menu, dynamically created.
For purposes of this example, each menu will have only a single item, some random number.
There is a method like this:
private
void
createTemplateGroupContextMenu(RadTreeViewItem groupNode)
{
RadContextMenu menu =
new
RadContextMenu();
menu.Items.Add(
new
RadMenuItem() { Header = rand.Next().ToString() });
RadContextMenu.SetContextMenu(groupNode, menu);
}
For each node that needs to have a menu, I am calling createContextMenu(node);
However, what happens is that the child nodes of such nodes are using the same context menu. I don't want the child nodes to have a context menu at all - in other words - I want to have a context menu only for nodes that I explicitely set.
How can this be achieved?