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

Expand specific items in load-on-demand treeview

2 Answers 64 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason Tung
Top achievements
Rank 1
Jason Tung asked on 17 Mar 2010, 02:57 AM
I have a load-on-demand treeview (such as the treeView-LoadOnDemand-Example), and I want to automatically  expand some items when loading the tree:
+ item1
     - item1.1
     - item1.2
+ item2
- item3
    - item3.1
        - item 3.1.1
        - item 3.1.2
  - item3.2
  - item3.3
+ item4
 + item5  
 + item6

how can i do it?  thanks

2 Answers, 1 is accepted

Sort by
0
Jason Tung
Top achievements
Rank 1
answered on 18 Mar 2010, 04:10 AM
cannot attach zip files.
For example, In the treeview-loadondemanditemlevels exapmle given by the administrator, I want to expand node:
          Bevareges->chang
and    Condiments-->Aniseed Syrup

thanks
0
Tina Stancheva
Telerik team
answered on 22 Mar 2010, 01:32 PM
Hello Jason Tung,

In your case you can use ContainerBindings and bind the IsExpanded property of your items to an IsExpanded property of the business object displayed by the RadTreeViewItem.

Then, while you are loading the products for the selected category,  you can check if the IsExpanded property of the product is set to True and if it is you can load the OrderDetail info for this product.

I have prepared a simple example demonstrating how you can accomplish this. Please take a look at it and let me know if it works for you or if I can help you further.

All the best,
Tina Stancheva
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
Jason Tung
Top achievements
Rank 1
Answers by
Jason Tung
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or