Darshan
asked on 02 Feb 2023, 10:18 AM
| edited on 02 Feb 2023, 10:19 AM
i need to display a grid with single row only...data i get for that row is a single object and not an array
each key of the object will be column .
But kendogrid expects a "data field" which is an array. How to achieve this ?
1 Answer, 1 is accepted
0
Konstantin Dikov
Telerik team
answered on 04 Feb 2023, 07:22 PM
Hello Darshan,
The field property must be set to the columns and it should point to a property of the data items collection set in the "data" property of the Grid. If there is no explicit definition of the Grid column, the Grid will automatically create the columns based on the data items passed to the component. Since you have only one object, you can pass an array with that single object to the Grid and it will generated the columns. Here is a simple example with this setup:
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.