I am trying to change the columns collection of my Kendo grid in the below way.
var grid = $("#grid").data("kendoGrid");
$http.get('/api/GetGridColumns')
.success(function (data) {
grid.columns = data;
})
.error(function (data) {
console.log(data);
});
This is changing the column collection but not reflecting immediately in my grid. But when I try to perform some actions in the grid (like grouping), then my new column set is appearing.
Please let me know how can I achieve this.
Regards, Dilip Kumar
If your grid is simple and you don't need to configure special column-specific settings, then you can simply omit the columns argument, as suggested in the API reference.
... and ....
You can do it by setting the KendoUI datasource, destroy the grid, and rebuild it
here you can just do this :
where you can retrieve the columns in a session or in a db
I'm use this code for change columns dynamic:
Weddin
Refresh the grid