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
1540
XamDataTree doesn't work for me.
posted

I've created a hierarchical data structure using ObservableCollection<T> where each item contains a public ObservableCollection<T> to connect to the next node.  The data structure is similar to the one in the DataUtil class which is in your DataTreeBinding example.

The problem is that only the root node gets displayed and I don't see an Expand Icon where I know there are sub-nodes in the data. What is the requirement in order to get the XamDataTree to recognize there are sub-nodes?

I'm binding in code like this:
this.MyTree.DataContext = m_menuData;
this.MyTree.ItemsSource = m_menuData.Centers;
where m_menuData is the object that contains the data and m_menuData.Centers
is the ObservableCollection<T> that contains the data hierarchy.

 

Parents
No Data
Reply
  • 5595
    posted

    Hi,

    Could you post the definition of your data structure?

    It is important to define the NodeLayout before the XamDataTree can display the child levels. If layouts are defined in the GlobalNodeLayout collection, you need to make sure that the Key property corresponds to the property name that is of type ObservableCollection<T> and TargetTypeName is the string name of the type of the items (T).

    HTH,

Children