This is a migrated thread and some comments may be shown as answers.

Self reference with tree list view

3 Answers 254 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
eliraz
Top achievements
Rank 1
eliraz asked on 24 Dec 2012, 09:26 AM
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.

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 24 Dec 2012, 10:02 AM
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.

0
eliraz
Top achievements
Rank 1
answered on 24 Dec 2012, 12:21 PM
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.
0
Dimitrina
Telerik team
answered on 24 Dec 2012, 02:54 PM
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.

Tags
TreeListView
Asked by
eliraz
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
eliraz
Top achievements
Rank 1
Share this question
or