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

Binding to self-referencing hierarchical data

1 Answer 83 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 24 Jul 2012, 07:10 AM
Good morning,

in my application I have a lot of data coming from the corresponding webservice. The data objects represent a tree structure without a fixed depth, so it may look like this structure below:

Group (arbitrary # of (sub)groups) -- Area -- City -- Office -- Department

So the groups may contain several layers of subgroups of the same data type, the deeper order is fixed (Area->City->Office->Department). The objects do have a ParentIds property (a list), so one object can be a child of different parents.

In your hierarchical data binding example the data structure has a fixed number of layers, could you provide me a little sample that binds to such data as described above from code behind? Thanks in advance!

Rob

1 Answer, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 24 Jul 2012, 07:29 AM
Hi Rob,

This article can get you started on how to use the RadTreeView control to display a hierarchy build from a flat collection. . However, please note that this article is a basic sample and if you need to implement an add/remove or drag/drop functionality in the RadTreeView, you'll have to extend the self-referencing data implementation like demonstrated in the attached sample.

Another useful resource is this forum thread that describes how to configure the entity model on the server to turn the flat colelction into a hierarchical collection and then display the hierarchy in the RadTreeView control.

I hope this information will help you, but please let us know if we can further assist you.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
Robert
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or