Update display of single row or cell

Hi,

I changed some properties of rowData in @recordClick, but the grid display is not updated.

Calling refreshColumns() solves the problem but it's too much.

I've tried updateRow() and updateCell() but neither works.


3 Replies 1 reply marked as answer

PS Pavithra Subramaniyam Syncfusion Team January 5, 2022 06:33 AM UTC

Hi Jenson, 
 
Thanks for contacting Syncfusion support. 
 
To achieve your requirement, we suggest you use the “setRowData” method which will update the row data and refresh the row. Please refer to the below API  
 
 
If this doesn’t meet your requirement, please share the below details that will be helpful for us to provide a better solution as early as possible. 
 
  1. Share your Grid code example
  2. Are you enabled the Grid editing feature? If yes what type of editing (Normal, Batch, Dialog) you are using
  3. Type of DataSource (local, remote)
 
Regards, 
Pavithra S 


Marked as answer

JE Jenson replied to Pavithra Subramaniyam January 5, 2022 07:46 AM UTC

Hi Pavithra,

Thanks for the reply, it solves my problem. But I still have a question:

In grid's API doc, I find a method called getPrimaryKeyFieldNames, so how to call setRowData if my grid has multiple primary key fields.



PS Pavithra Subramaniyam Syncfusion Team January 6, 2022 09:15 AM UTC

Hi Jenson, 

It is great to hear that the provided solution solved your problem! 

The “getPrimaryKeyFieldNames” method returns all primary key column names in an array format and by default the Grid will consider the first column of this array for update action. So, we suggest you pass the “getPrimaryKeyFieldNames()[0]” value to the “setRowData” method. 

Regards, 
Pavithra S 


Loader.
Up arrow icon