There is no straightforward way to redirect from an item in the context menu, like setting a property. However, you can achieve the task by subscribing to the BeforeClientContextClick event.
Example:
| ASPX |
Copy Code |
<script lang = "javascript" > function Redirect(node, itemText) { if (node.Text == "USA" && itemText == "Country info") { window.location.href = "http://www.google.com"; } } </script> ... <rad:RadTreeView runat="server" BeforeClientContextClick="Redirect"> </rad:RadTreeView> |
| Treeview XML Content File |
Copy Code |
|
<Tree> <Node Text="North America"> <Node Text="USA" ContextMenuName="Country"> <Node Text="New York"/> <Node Text="Los Angeles"/> <Node Text="Boston" /> <Node Text="Chicago" /> </Node> </Node> <Node Text="Canada"> <Node Text="Toronto" /> <Node Text="Vancouver" /> <Node Text="Calgary" /> <Node Text="Ottawa" /> </Node> <Node Text="Mexico"> <Node Text="Campeche" /> <Node Text="Guadalajara" /> <Node Text="Mexico City" /> <Node Text="Puebla" /> </Node> </Tree> |
| ContextMenu XML File |
Copy Code |
|
<ContextMenu> <Menu Name="Country"> <Item Text="Country info"/> <Item Text="Country economics" /> <Item Text="Country politics" /> <Item Text="Country demographics" /> </Menu> </ContextMenu> |