Hi Alireza,
Greetings from Syncfusion support
After reviewing your query, we could see that you like to
change the value of the cell and while tried with setCellValue it didn’t work.
Based on your query we have prepared a sample and tried to reproduce your
reported problem at our end, but it was unsuccessful. Please refer the below
code example and sample for more information.
|
Index.cshtml
<script>
document.getElementById("button").addEventListener("click", () => { //button
click event
var grid =
document.getElementsByClassName('e-grid')[0].ej2_instances[0];
grid.setCellValue(10002,
"CustomerID", "Modified");
});
</script>
|
Sample:
API: https://ej2.syncfusion.com/documentation/api/grid/#setcellvalue
We would like to inform you that, we have used setCellValue
method to update the values in cell. It changes the value only in UI and does
not affect the dataSource. If you want to change the value in both UI and
dataSource, then you need to use updateRow method. Please refer the
below API for more information.
API: https://ej2.syncfusion.com/documentation/api/grid/#updaterow
If still you have any issue, please share the below details
that would be helpful for us to provide better solution.
1)
Share your complete Grid rendering code.
2)
Share the details about what type of edit mode (Normal/Batch/Dialog) you are
using in your application.
3)
Share your Syncfusion package version.
Regards,
Rajapandi R
Attachment:
185577_cd3aad35.zip