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

TreeView inside ComboBox

3 Answers 45 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Pia
Top achievements
Rank 1
Pia asked on 19 Apr 2010, 10:22 AM
Hi

How to add sorting to RadTreeView

Thanks

3 Answers, 1 is accepted

Sort by
0
Chip
Top achievements
Rank 1
answered on 19 Apr 2010, 02:45 PM
The TreeView is displayed using the order of the data it's bound to. If you are loading the data from SQL, you can use OrderBy to sort the query - http://www.w3schools.com/sql/sql_orderby.asp
0
Pia
Top achievements
Rank 1
answered on 19 Apr 2010, 02:48 PM
Thanks for your reply.

Is there any way to do it on using javascript ?

0
Nikolay Tsenkov
Telerik team
answered on 19 Apr 2010, 04:44 PM
Hello Pia,

You need to call .FindControls on the RadComboBoxItem which holds the TreeView. If you have only 1 Item, than you can directly access it:

cbParameters.Items[0].FindControl("tvParameters");

You probably won't need more than 1 TreeView there - if there are more every single tree can be represented as a subTree of a bigger one.

Also, just to be sure that the item(s) is/are instantiated from your ItemTemplate, place:

cbParameters.DataBind();

before accessing the tree(s).

This will ensure that the tree(s) is/are populated (the searched control(s) exist(s)).


Finally, there is a great article exactly for your case and I recommend you reading it:

http://www.telerik.com/help/aspnet-ajax/combobox-find-item-in-template.html


Hope this will help you! :)

Kind regards,
Nikolay Tsenkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Pia
Top achievements
Rank 1
Answers by
Chip
Top achievements
Rank 1
Pia
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or