Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
how to enable xamtree nodes always expanded?
posted

I try to use XamTree in my app. The data for the XamTree is bound to ItemSource. After that, I need following kind of code to expand the tree:

 foreach (var item in this.MyTreeview.XamTreeItems)
            {
                ((XamTreeItem)item).IsExpanded = true;
            }

With the codes, it needs to hookup async complete event. That is not what I want.

As the ItemSource could be dynamically and loaded by VM with async call with wcf-ria service. I want to everytime then Data for ItemSource loaded by VM, the the tree can be expanded automatically without code. Anyway to do it with some setting in Xaml?

  • 138253
    Offline posted

    Hello Benjamin,

     

    I am just checking if you got this worked out or you still require any assistance or clarification on the matter.

  • 138253
    Offline posted

    Hello Benjamin,

     

    Thank you for your post. I have been looking into it and I created a sample project for with the functionality you want. Basically I created a Style for the XamTreeItem and set the IsExpanded Property to true. This way every time when a tree item loads it will be expanded. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamTreeExpanded.zip