Angular datagrid binding

1 Answer 79 Views
Designs, skins, themes Forum suggestions Miscellaneous Telerik Trainer
Akash
Top achievements
Rank 1
Akash asked on 10 May 2023, 08:01 PM | edited on 16 May 2023, 03:52 PM

Hi all,

 

I am using Kendo UI with Angular. I want to show some data in my Kendo Grid but I am stuck at a point as the json data I am using is of multiple level.

Json data:

{

"colleges": [

{

"id": 1,

"name": "test 1",

"entities": [

{

"type": "teacher",

"name": "Dan"
}

]

},

{

"id": 2,

"name": "test 2",
"entities":

[

{

"type": "student",

"name": "David"

}
]
}

],

"status": "Success"

}

 

I want to show data in the below form:

 

College name            Student name                  Teacher name

test 1                                                                          Dan

test 2                            David

 

Your valuable response will be appreciated. Please feel free to contact back if any question.

 

Thanks,

Akash Verma

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 15 May 2023, 11:51 AM

Hi Akash,

Thank you for the provided code snippet.

The Grid data input property generally supports only one-level arrays or objects or a GridDataResult, where the data property is supposed to be a one-level array.

https://www.telerik.com/kendo-angular-ui/components/grid/data-binding/

In case there are more levels of arrays, then the Grid won't be able to represent the data as desired (speaking for more complex scenarios), and built-in filtering or other data built-in data operations won't work.

I would suggest reconstructing the data so that it consists of a single array level and then defining the desired Grid columns.

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Akash
Top achievements
Rank 1
commented on 16 May 2023, 03:29 PM

Hi Martin,
Thanks for your response.

 

Regards,

Akash Verma

Tags
Designs, skins, themes Forum suggestions Miscellaneous Telerik Trainer
Asked by
Akash
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or