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

Bind to Grid

3 Answers 209 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
GM72
Top achievements
Rank 1
GM72 asked on 14 Jan 2016, 12:34 PM

Hi,

I have a complex object like

ID 

Name

Dob

EmploymentDetailsObject

EmergencyContactObject

I want to bind this to a Kendo Grid so the ID/Name/Dob/ are the parent row and the EmploymentDetails and EmergencyContact are child rows to this parent

I return a collection of these from an API. I thought I could just bind this collection to the Grid but it doesn't seem to work?

 Can I do this? What do I need to do?

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 18 Jan 2016, 11:36 AM
Hi,

The Grid does not support the use of HierarchicalDataSource, however you could achieve similar results using a regular DataSource. As a workaround you can try using the detailInit event handler to get the data from the complex object and populate the child Grid's DataSource with it (see similar example here). I would also recommend considering the TreeList widget instead.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
GM72
Top achievements
Rank 1
answered on 18 Jan 2016, 12:00 PM

Hi,

 I thought about that but I was interested in multiple childs for 1 parent - is this possible using this method??

 Thanks

0
Alexander Popov
Telerik team
answered on 20 Jan 2016, 09:28 AM
Hi,

Having multiple child Grids is possible and can be done using the detailInit event handler. Instead of initializing just one Grid as shown here, initialize as many as necessary.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Hierarchical Data Source
Asked by
GM72
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
GM72
Top achievements
Rank 1
Share this question
or