kendo-uikendo-grid

Refresh a single Kendo grid row


Is there a way to refresh a single Kendo grid row without refreshing the whole datasource or using jQuery to set the value for each cell?


Solution

  • How do you define the row that you want to update? I'm going to assume that is the row that you have selected, and the name of the column being updated is symbol.

    // Get a reference to the grid
    var grid = $("#my_grid").data("kendoGrid");
    
    // Access the row that is selected
    var select = grid.select();
    // and now the data
    var data = grid.dataItem(select);
    // update the column `symbol` and set its value to `HPQ`
    data.set("symbol", "HPQ");
    

    Remember that the content of the DataSource is an observable object, meaning that you can update it using set and the change should be reflected magically in the grid.