how to manually set column value in kendo grid

Austin Hoh picture Austin Hoh · Jan 3, 2017 · Viewed 18.8k times · Source

I was able to set the remark on console but I have no idea how to set the remark value into the grid once the user save the changes.

is there anyway to set value into kendo grid manually?

example output

         |Remark         |User Name|Phone Number|Country
 [unable]|username length|ad       |0123456789  |UK
 [enable]|               |admin2   |0123456222  |US
 [enable]|               |admin3   |0123333339  |CN

after user edit the table - output

         |Remark         |User Name|Phone Number|Country
 [enable]|               |admin1   |0123456789  |UK
 [enable]|               |admin2   |0123456222  |US
 [enable]|               |admin3   |0123333339  |CN

The sample of project is provided in the code snippet.

Answer

DontVoteMeDown picture DontVoteMeDown · Jan 3, 2017

Always use set() method from the Model to change values. No need to refresh(), e.g.:

var dataItem = $("#grid").data("kendoGrid").dataSource.data()[0];
dataItem.set("reason", "new value");

Demo