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
1205
WinTree Binding
posted

How do I establish a relationship in WinTree using 2 BindingLists?


Thank you.

 

  • 29105
    Suggested Answer
    Offline posted

    Hello 2001plus,

    By default you cannot bind the UltraTree to two separate class objects. The sample I attached illustrates that a class can consist of multiple bindinglists, but they need to reside together. For example, the sample includes a class named Person. I created a couple lists of type Person to add to the tree. Then I created a new BindingList<Person>(list). Notice that the 'list' is referenced to indicate which list I want to bind. You can append the Concat IEnumerable to reference an additional list, like so:

    var bindinglist = new BindingList<Person>(list).Concat(new BindingList<Person>(list2));

    The sample even demonstrates a relationship by creating children nodes from another BindingList as well and placed within the Person class.

    BindingListsToTree.zip