updateCell method doesn't work in Grid

Hi, I have a problem with updating a cell on row selection, the updateCell method doesn't do anything. And I don't want to refresh the whole grid.

I made a very simple sandbox where you can check this issue: https://stackblitz.com/edit/syncfusion-grids-8qqz79?file=src%2Fapp%2Fapp.component.ts

Thank you!


1 Reply

RS Rajapandiyan Settu Syncfusion Team August 8, 2022 01:37 PM UTC

Hi Alex,


Thanks for contacting Syncfusion support.


The updateCell method only works with batch Edit mode. To perform CRUD actions in the EJ2 Grid, kindly refer to the below documentation and demos,

Docs:

https://ej2.syncfusion.com/angular/documentation/grid/editing/in-line-editing/
https://ej2.syncfusion.com/angular/documentation/grid/editing/dialog-editing/
https://ej2.syncfusion.com/angular/documentation/grid/editing/batch-editing/

Demos:
https://ej2.syncfusion.com/angular/demos/#/bootstrap5/grid/normal-edit

https://ej2.syncfusion.com/angular/demos/#/bootstrap5/grid/dialog-editing

https://ej2.syncfusion.com/angular/demos/#/bootstrap5/grid/batch-editing


If you want to update the cell value only in the UI, you can use setCellValue method.


sellCellValue: https://ej2.syncfusion.com/angular/documentation/api/grid/#setcellvalue

 

  btnClick(args) {

    this.grid.setCellValue(104, 'CustomerID', 'Modified');

  }

 


sample: https://stackblitz.com/edit/syncfusion-grids-xvurfx?file=src%2Fapp%2Fapp.component.ts


If you want to update the cell value in both UI and dataSource, you can use updateRow method which refreshes the Grid to affect the changes.


updateRow: https://ej2.syncfusion.com/angular/documentation/api/grid/#updaterow


If this does not meet your requirement, kindly explain your requirement in detail with a video demo to provide a better solution.


Regards,

Rajapandiyan S


Loader.
Up arrow icon