Good day,
maybe who faced and will prompt.
There are two telerik grids on the page; when you click on the line of the first grid, you need to update the second with the data from the query in the database. Accordingly, I managed to catch the event of pressing the desired string, take its id and send it to controll to form a query in the database to display the necessary information in the second grid.
But then I don’t understand how to assign the received json result to my controll as a new data source for the second grid and update it.
Tell me who faced, thank you!
<!-- language: lang-js --> <script type="text/javascript"> function onButtonClick(e) { e.preventDefault(); var grid = $("#grid1").data("kendoGrid"); var selectedItem = grid.dataItem(grid.select()); $.ajax({ url: "/myControll/ReadDataMethod", type: "GET", data: { id: selectedItem.Id} }).done(function(returnData) { $("#grid2").data("kendoGrid").dataSource.data(returnData); $("#grid2").data("kendoGrid").dataSource.read(); }); } </script>