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

[Solved] TreeViewItemModel Selected Member

2 Answers 45 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cesar
Top achievements
Rank 1
Cesar asked on 10 Feb 2012, 07:43 PM
Hello I'm trying to do some client side binding of a tree view, however when I'm returning the JSON result back I need to set the selected node with some logic of my own. Turns out I do not see the "Selected" Property on the TreeViewItemModel as it is on the TreeViewItem when you map the items on the Tree definition on your view.

Is there any way to set the as Selected a TreeViewItemModel node?

Thanks I would really appreciate your help.

2 Answers, 1 is accepted

Sort by
0
Erik
Top achievements
Rank 1
answered on 21 Feb 2012, 05:36 PM
I too would like to know how to handle this, since as I understand it, the TreeViewItem is deprecated.
0
Alex Gyoshev
Telerik team
answered on 22 Feb 2012, 12:18 PM
This functionality is currently unsupported, but the TreeViewItemModel is not deprecated (we deprecated it for one official release, but realized that it was useful enough to remain, so it is not deprecated anymore).

You can add the Selected field to the TreeViewItemModel and the TreeView will render the item as selected. However, if there is an already selected item, the TreeView won't un-select it, so you'll need to address this problem with JavaScript (i.e. remove the previously selected item manually).

Regards,
Alex Gyoshev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
Cesar
Top achievements
Rank 1
Answers by
Erik
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or