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

column headers and data source

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 01 Mar 2013, 02:04 AM
I have a datasource setup (JSON) to populate a grid...Maybe I am missing something simple, but since the grid will be populated by the results of a query, the number of titles (and of course data type) for each column will change just about each time a query is run.  How do I programmatically set the column headers and associated details based on the returned JSON?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 04 Mar 2013, 04:24 PM
Hello Aaron,

Grid columns as well as the DataSource's schema should be set during the initialization of the components and cannot be changed dynamically after that. As a workaround you may consider retrieving the grid settings via Ajax request and building the Grid at the success event of this request.
Alternatively you may completely destroy and recreate the widget and its dataSource.

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