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

2 Treeviews - binding on checkednodes

1 Answer 39 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rhyss
Top achievements
Rank 1
Rhyss asked on 08 Nov 2010, 12:55 PM
Hi all,
what i am trying to do is have two treeviews on a page.  one is bound to a datasource with checkboxes.

What i want to happen is that as a user checks the checkboxes in one treeview, just the checked items appear in the second treeview.

I tried to bind the second treeview to the RadTreeView1.Checknodes list, but that list does not maintain the different levels of the item.  eg.  a list like
  • A
    • B
    • C
    • D
  • E
    • F

So if i select A (that is set to select all the children as well) binding to the checkednodes just gives a flat treeview

  • A
  • B
  • C
  • D

I want to to come out indented as the original.

Note: if B is selected, A is selected as a partial selection (tristate checkbox) so the full branch should always be selected.

Ideas?

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 10 Nov 2010, 06:28 PM
Hello Jordan,

Well you need only to check which of the nodes are at the lowest level (on the server the property is node.Level) and add them directly in the Nodes collection of the TreeView (they will persist all the connections with child nodes, the child nodes with their child nodes and so on).

Hope this is going to help you!


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
Rhyss
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or