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

Update MVC grid with new, different columns

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
felix
Top achievements
Rank 1
felix asked on 23 Sep 2014, 01:16 PM
I have a mvc grid that is populated with a datasource generated by a datable, the problem is that when i change the datable result the columns of the grid doesnt change.

On the other hand the rows changes because i can see the number of items changed.

I would like to know how to change the columns when i change the datatable result.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 25 Sep 2014, 08:38 AM
Hello Felix,

There are some settings, which are not designed to be changed after Grid initialization, and those include the column set and the dataSource schema. Although there are hacks to achieve the desired behavior, the recommended approach in your case is to destroy the Grid, empty its element and create a new instance with Javascript with the new correct settings.

destroy
http://docs.telerik.com/kendo-ui/framework/widgets/destroy

client-side initialization
http://demos.telerik.com/kendo-ui/grid/remote-data-binding

Regards,
Dimo
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
felix
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or