Update MVC grid with new, different columns

2 posts, 0 answers
  1. felix
    felix avatar
    1 posts
    Member since:
    Jun 2014

    Posted 23 Sep 2014 Link to this post

    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.
  2. Dimo
    Admin
    Dimo avatar
    8472 posts

    Posted 25 Sep 2014 Link to this post

    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.

     
Back to Top