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

Is this possible to databind nodes from various sources (with keeping parent/child relations)?

4 Answers 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
GrZeCh
Top achievements
Rank 2
GrZeCh asked on 18 Jul 2008, 03:10 PM
Hello!

Is this possible to databind from codebehind various nodes with different datasources which have id_parent collumn and keep this structure in RadTreeView?

Thanks

4 Answers, 1 is accepted

Sort by
0
GrZeCh
Top achievements
Rank 2
answered on 20 Jul 2008, 01:27 PM
Can this be done by creating a "global" list (with fields id_item, id_parent, name) where each datasource will have different prefix for id_item and id_parent fields?

I tryed to create list from only one datasource with mentioned fields and after databinding it to RadTreeView instead of hierarchical tree every node was in 0 level (in List items had correct id_parent value).

EDIT:

I think my question is related to this topic:

http://www.telerik.com/forums/linq-support-for-radtreeview

Can I databind List with hierarchical data to RadTreeView and keep hierarchy?
0
Atanas Korchev
Telerik team
answered on 21 Jul 2008, 07:14 AM
Hello GrZeCh,

RadTreeView can databind hierarchically only to DataSet/DataTable/DataView and classes which implement IHierarchicalDataSource/IHierarchicalEnumerable. We have a code library demonstrating how to create a custom IHierarchicalDataSource. You can check it out here.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 22 Jul 2008, 08:41 PM
as far I can see in provided example there is different approach for hierarchy (no ParentID usage)

Is this possible to databind RadTreeView with Dictionary created using methond mentioned in this post (or maybe modified version of this method):

http://www.telerik.com/support/code-library/r-a-d-treeview-binding-using-hierarchicaldatasourcecontrol-class-and-custom-business-objects-collections

?
0
Accepted
Atanas Korchev
Telerik team
answered on 23 Jul 2008, 07:33 AM
Hi GrZeCh,

No. RadTreeView can only bind to IHierarchicalDataSource/IHierarchicalEnumerable and DataSet/DataTable/DataView. You may consider programmatically creating nodes by traversing your dictionary object.

Greetings,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
GrZeCh
Top achievements
Rank 2
Answers by
GrZeCh
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or