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

How to Disable or enable Items in Rad Menu based on TreeView Node Value

4 Answers 102 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 29 Sep 2008, 01:51 PM
Is it possible to have a different context menu for a tree based on the node name?

I currently have server side code that creates the tree and then applies a menu, like so:

m_RadTreeFolderHierarchy.ContextMenus.Add(

New RadTreeViewContextMenu())

m_RadTreeFolderHierarchy.ContextMenus(0).LoadContentFile(

"~/TreeSupport/TreeMenu.xml")


How would I change the menu for one node, and keep the default for the rest?

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 Sep 2008, 01:56 PM
Hello Bob,

You can check this help topic.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 29 Sep 2008, 03:59 PM
That post was not relavant.  I am already hadling the events.  My question was:
"Is it possible to have a different context menu for a tree based on the node name?"

Stated differently:

I would like the context menu for node a show the following options:
  •     Refresh my item list

For all other nodes, I would like the context menu options:

  • Move Up
  • Move Down
  • Delete
0
Bob
Top achievements
Rank 1
answered on 29 Sep 2008, 04:21 PM
Or... Can the tree xml definition containg contextmenu definitions at each level?
0
Bob
Top achievements
Rank 1
answered on 29 Sep 2008, 05:21 PM
Found the solution:   ContextMenuID= can be changed at runtime, or added to each node.

When I create the default menu, I also create additional and assign them either in code, or in the xml for the tree.
Tags
TreeView
Asked by
Bob
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Bob
Top achievements
Rank 1
Share this question
or