Posts

Showing posts with the label Kendo Asp.Net Mvc

Change Kendo Grid Datasource Use JS

Answer : I think you should first create a new DataSource (see https://demos.telerik.com/kendo-ui/datasource/remote-data-binding for remote data) var dataSource = new kendo.data.DataSource({ data: [ { name: "John Doe", age: 33 } ] }); And then append it to the grid by using the setDataSource method (https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setdatasource) var grid = $("#grid").data("kendoGrid"); grid.setDataSource(dataSource); Since you want to change the action for your read then you can just do that. According to this question you could just set the dataSource Read url and refresh your grid data with something like that: var grid = $("#grid").data("kendoGrid"); grid.dataSource.transport.options.read.url = "newUrlPath"; grid.dataSource.read(); grid.refresh(); If you don't actually want to change your dataSource but your data and possibly get your list of items from some aj...