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

Sorting Treenodes selectively

1 Answer 44 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Albert Shenker asked on 07 Aug 2008, 08:42 PM
I have a standard treeview and I want the nodes to be sorted alphabetically. The treeview is built dynamically from a database. In some instances, I would like for a particular node's child nodes to not be sorted alphabetically. In other words, for a particular branch to be listed in the order it was built.Is there any way to do this, or is the sorting only possible on the whole tree? I can, of course, turn sorting off, and presort my data according to my needs and then populate the tree. However, I really like the sort property in instances where I need to insert a node in response to a client-side action.

My scenario is as follows. I have a tree of "Folders". Some folders have child nodes that represent "Person Names". These can be sorted by node text and everything is fine. However, some other folders have sub nodes which represent time-stamped objects, and I would like these to be sorted by the timestamp (according to the order retrieved from the database), rather than alphabetically by the node text.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Aug 2008, 06:36 AM
Hi Albert Shenker,

First of all which version of RadTreeView are you using? The Sort property of RadTreeView has been retired for some time now due to various problems it was causing.

I would suggest you sort (or don't) the data used to populate the nodes. This is by far the most flexible way to sort or not the tree nodes of RadTreeView.

Regards,
Atanas Korchev,
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Answers by
Atanas Korchev
Telerik team
Share this question
or