Hierarchy of same object bound

2 posts, 0 answers
  1. Dan
    Dan avatar
    11 posts
    Member since:
    Feb 2012

    Posted 17 Nov 2012 Link to this post

    Simple question that I was not quite able to find an answer to...
    I have a binding list collection of Person objects.  Each Person object has a collection of Person objects.  For example, everyone is a person.  Some persons have children.  They are persons.  They can have kids, and so on and so on.

    I bound this to a tree view but only got the first level of items.  I then added ParentMember and ChildMember values - these are used for a simple collection as compared to my hierarchy of same nodes thus it did not work.  I then tried to use the Object Relation mode and specified a display value that hit the first level of nodes and then went to the second level - "PersonName\\PersonName".  I did the same with the ValueMember.  Great, I now got two levels of tree control. 

    The question is how to get N levels?  Do I do something like "PersonName\\*" in an attempt to tell it to repeat?  Do I need to do this manually rather than binding?

    And lastly, I did read that Drag And Drop will NOT work with bound Trees.  If that is the case then I will do all of this work manually - I would think that you could support drag and drop but would have to rely on my code to actually do the movement of the actual data structure.
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 22 Nov 2012 Link to this post

    Hello Dan,

    Thank you for contacting Telerik support.

    What I can suggest is to use self-reference data binding to display the desired hierarchical data. Please, refer to the attached project.

    As to the drag and drop, it is not supported in bound mode, since the data binding scenarios are multiple and each one has some restrictions.

    Do not hesitate to contact us if you have other questions.

    All the best,
    Peter
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top