Expand specific items in load-on-demand treeview

3 posts, 0 answers
  1. Jason Tung
    Jason Tung avatar
    8 posts
    Member since:
    Mar 2010

    Posted 16 Mar 2010 Link to this post

    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. Jason Tung
    Jason Tung avatar
    8 posts
    Member since:
    Mar 2010

    Posted 17 Mar 2010 Link to this post

    cannot attach zip files.
    For example, In the treeview-loadondemanditemlevels exapmle given by the administrator, I want to expand node:
    and    Condiments-->Aniseed Syrup

  3. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 22 Mar 2010 Link to this post

    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.
Back to Top