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
340
Hierarchical databinding against ultrawintree
posted

I have a bindinglist containing three columns nodeId, NodeName and parentNodeId

When I set the datasource to that bindinglist how do I get the ultrawintree to handle the hierarchy so that each node is connected to the correct parent?

  • 469350
    Offline posted

    Hi,

    The tree binds to the structure you give it. If you give the tree a flat BindingList, then it will only show a flat list.

    If you want to create a hierarchy, you have to give the tree a hierarchical data source, or else manually populate the tree without data binding.

    So one way to do this would be to use a DataSet instead of a BindingList. The DataSet support hierarchical data via Relationships.

    Another option would be for the items in your BindingList to have a property that returns the child BindingList<T> that contains the child items.

  • 29065
    Suggested Answer
    Offline posted

    Hello,

    The DotNet BindingManager determines the data structure of the UltraWinTree. Like the UltraWinGrid the Tree queries the Binding Manager for each level of entities in order to create its schema based on the underlying object model. If the Binding Manager does not recognize the custom collection and child members, then the Tree cannot either.

    For more details I recommend visiting our online documentation:

    1. IList and IBindingList

    2. Binding WinTree to a Hierarchical Data Source

    If the Tree is only displaying one root node level then there may be missing relations with your parent and child tables. If you could please send us a sample then we can look into this further.

    Let me know if you have any questions regarding this matter.