Self reference with tree list view

4 posts, 0 answers
  1. eliraz
    eliraz avatar
    20 posts
    Member since:
    Nov 2010

    Posted 24 Dec 2012 Link to this post

    Hello

    I would like to know if it is possible to use a single data source with the tree list view and describe the self referencing parent-son relationship in the data (ID property and ParentID propert), in opposition to having each node contain a property listing all of its sons.

    I managed to do this with the rad grid view, but this is not satisfactory to me, i want to state which objects are root, in the grid view the nodes appear in both the first level and under their parent (I found this to exist in your examples as well), in addition the control operates as a master detail with several levels.

    This was actually asked before on this thread:
    http://www.telerik.com/community/forums/wpf/treelist/self-reference-with-datatable.aspx

    but no actual response was made.

    Thanks in advance.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Dec 2012 Link to this post

    Hello,

    Indeed, unfortunately you cannot define GridViewTableDefinitions with RadTreeListView. I can suggest you to use the approach from this example instead. The demo shows how to load the data on demand using your self-referencing logic.

    I hope this helps.
     

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. eliraz
    eliraz avatar
    20 posts
    Member since:
    Nov 2010

    Posted 24 Dec 2012 Link to this post

    Hello Didie,
    First of all I've already seen this example and it isn't self referencing, "Folders" references "Items"(though items references more items), and I suspect that's how you distinguish root items from the rest of the nodes.

    But that's not the issue with this approach, I've mentioned that I want the control to associate the son and parent rows for me, without me giving a property of a "sons collection" in each node.
    Because I intend to bind to a data source that is dynamic and the hierarchy could change during runtime and I'd have to keep track of that and make the son collection live enough to add and remove sons.

    The thing is that we have a very big project and we're trying to undergo a technology upgrade from WinForms(Janus grid) to WPF
    and the current Janus grid does that for us.

    Awaiting your reply.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Dec 2012 Link to this post

    Hello,

    If you want to use an approach as the one you have found for the GridView, then you can check the approach from this post with RadGridView simulating TreeListView-like structure.  

    You can also check this forum thread about loading self-reference on demand.

    Greetings,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top