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
240
How to expand nodes in XamDataTree after ItemsSource is set ?
posted

Hi, I’m trying to expand all nodes in XamDataTree after ItemSource is set by ViewModel.  ViewModel calls  UpdateOnData() :

public void UpdateOnData()

{

     SetNodeExpandedState (ReconRunsTree.Nodes, true);

}

private void SetNodeExpandedState (IEnumerable<XamDataTreeNode> nodes, bool expand)

{

     foreach (XamDataTreeNode item in nodes) // ??? nodes collection is empty

     {

          item.IsExpanded = expand;

          this.SetNodeExpandedState(item.Nodes, expand);

     }

}

The problem is – Nodes collection is empty, even though ItemsSource is set properly. At which point after ItemsSource is set, the Nodes collection becomes populated ?

Parents
  • 138253
    Offline posted

    Hello Sergey,

     

    Thank you for your post. I have been looking into it and I can say that in when the XamDataTree’s Loaded event is fired the Nodes collection is already populated, so you can use it in order to achieve your goal. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

Reply Children