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

Assign lists of different types to Tree View at any level

1 Answer 169 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kavitha
Top achievements
Rank 1
Kavitha asked on 24 Jul 2013, 08:53 PM
Lets say i have different types 'A','B','C' in my app 

and I am trying to assign this below result of type 'A'

class A
{
  List<B>

  List<C>
}

to the tree view at any level. Can the tree view read all the list items of B and C from the object of type 'A'.

Something like this below:

+ B (parent tree view items)
     - child tree view items
+ C (parent tree view items)
    - child tree view items

Please help with any suggestions.








1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 26 Jul 2013, 11:40 AM
Hello Kavitha,

I am afraid that the TreeView does not support to use heterogeneous data items for specific level of the hierarchy. You can use different types of objects for the different levels but on the same levels you cannot have different types of objects and there is no work-around to this

The following demo demonstrates different types for the different levels of the hierarchy:

http://demos.kendoui.com/web/treeview/odata-binding.html


Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Nico
Top achievements
Rank 1
Iron
commented on 28 May 2024, 12:52 PM

Hello, is the answer still current? 

best regards

Martin
Telerik team
commented on 30 May 2024, 06:41 AM

Hello, Nico,

Could you please elaborate about the requirement, as I am not sure I understand it? If you could provide an example of your TreeView configuration, or the data you wish to bind to the component, I would be able to investigate further.

Nico
Top achievements
Rank 1
Iron
commented on 30 May 2024, 08:36 AM

Hello,

its been dealt with. But i have another issue. I have a treeview and a editService as a directive/datasource. Anyway the nodeDrop called twice. Have u any idea why nodeDrop is called twice. Best regards Nico

   

this.treeview.nodeDrop.subscribe(x=>console.log(x));

 

Martin
Telerik team
commented on 03 Jun 2024, 07:08 AM

Hello, Nico,

The jQuery TreeView doesn't have a nodeDrop event, so I guess you are referring to the Kendo for Angular component. Kindly open a new thread in the respective forum.

Tags
TreeView
Asked by
Kavitha
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or