Toolbar's Update button not working

I have a simple <sfgrid> just like the demo. The Update button stays black after clicked and seems dead. The OnActionCompleted handler is invoked when the Add button is clicked but nothing from the update button why?

3 Replies 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team April 12, 2021 01:14 PM UTC

Hi Pierre, 

Greetings from Syncfusion. 

Query: Toolbar's Update button not working 

We have validated your query and checked the reported problem at our end. We could not face the reported problem. While clicking the update button, the update operation works fine and the OnActionComplete event is triggered fine. Find the below sample for your reference. 


If you are still facing the problem, then could you please share the below details. It will be helpful to validate and provide a better solution. 

  • Reproduce the problem in the provided sample and revert back to us.
  • Share a simple reproduceable sample if possible.

Regards, 
Rahul 



PI Pierre April 12, 2021 03:12 PM UTC

I found that one of the column have to be defined as a primary key for the update button to work while the Add button works without it. I don't need a primarykey so I just created a dummy invisible column with  primarykey set to true and it started working. Is there a better solution ? Thanks for your answer.



RN Rahul Narayanasamy Syncfusion Team April 13, 2021 12:06 PM UTC

Hi Pierre, 

Thanks for sharing the details. 

We have validated your query and from your shared information, you have not defined primary key for one of the Grid columns(in which the column have unique values). We would like to inform you that the Primary key column is required for Editing feature.  

Editing feature requires a primary key column for CRUD operations. To define the primary key, set IsPrimaryKey to true in particular column whose value is unique

Reference: 

So we suggest you to set the IsPrimaryKey to any one of the columns(which column has a unique value) to resolve the problem. 

Please let us know if you have any concerns. 

Regards, 
Rahul 


Marked as answer
Loader.
Up arrow icon