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

Auto expand node when children are added

4 Answers 104 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 12 Nov 2009, 05:58 PM
Hi,

I have a treeview bound to an observablecollection, each node has an observablecollection of children and so on for the entire hierarchy. Is there a way to have the treeview node expand automatically as children are added to the object that it is bound to?

Thanks,

4 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 13 Nov 2009, 01:41 PM
Hello Ben,


Regards,
Boryana
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
Bobi
Telerik team
answered on 13 Nov 2009, 01:43 PM
Hi Ben,

Please find attached a sample project.
I hope that this will help you.
Please let us know if you have any other questions or need some more help.

Greetings,
Boryana
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
Ben
Top achievements
Rank 1
answered on 13 Nov 2009, 03:57 PM
I forgot to mention that all the tree items are loaded on demand.

The complete picture is:

1) User uses a seperate interface to search for an item.
2) Item is located somwhere within the hierarchy of the tree, none of the tree nodes have been loaded yet.
3) Using a collection of identifiers I want to expand a sequence of nodes to expose the item the user searched for.

Since my tree is already bound to a hierarchy of observablecollections I thought it would be easier to just figure out how to have nodes expand automatically when children are added.

0
Kiril Stanoev
Telerik team
answered on 19 Nov 2009, 12:50 PM
Hello Ben,

I have prepared a small project that demonstrates how add an item to a node and expand the treeview to that node. The treeview in the demo has a 3-level hierarchy. Have a look at the sample project and let me know how this works for you.

Best wishes,
Kiril Stanoev
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.
Tags
TreeView
Asked by
Ben
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Ben
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or