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

Treeview data binding and menu

2 Answers 50 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
yoav roytenberg
Top achievements
Rank 1
yoav roytenberg asked on 24 Jan 2010, 04:46 PM
Hi!

Working with treeview I encountered some problems:

1. How can i override the default context menu methods (like add and delete)
2. My data structure is a decision tree made out of nodes, where each node has child nodes in an array. Is there an elegant way
   to bind my data structure with the tree view?

2 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 25 Jan 2010, 11:06 AM
Hello yoav roytenberg,

 Thank you for writing.

The standard RadTreeView context menu can not be overridden, but it can be replaced with your own. For example:

RadContextMenuManager mgr = new RadContextMenuManager();
RadContextMenu menu = new RadContextMenu();
menu.Items.Add(new RadMenuItem("Asdf"));
menu.Items.Add(new RadMenuItem("Zxcv"));
menu.Items.Add(new RadMenuItem("Qwer"));
mgr.SetRadContextMenu(this.radTreeView1, menu);

 

You can bind to a hierarchy of custom objects (nodes in your case) by setting a data relation. Please refer to the online documentation for doing so.

Write again if you have other questions.

Best wishes,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stefan
Telerik team
answered on 22 Mar 2011, 04:45 PM
Hello yoav roytenberg,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

Regards,
Stefan
the Telerik team
Tags
Treeview
Asked by
yoav roytenberg
Top achievements
Rank 1
Answers by
Victor
Telerik team
Stefan
Telerik team
Share this question
or