Is it possible to Edit Primary Key Column once it has been saved ? Currently, I have auto populated column set for Primary key. once it has been saved. It's disabled. and not goes into edit mode. But If i make isPrimaryKey=false then it makes it editable. in this case it is not able to retain change values when clicked on update button in toolbar.
Hi PDev,
Thanks for contacting Syncfusion support.
In the EJ2 Grid component, our CRUD operations and some other features are depending on the Primary key value. So, It is not suggestible to modify the already saved Primary Key value of the column.
Regards,
Pavithra S
I have 2 queries
Hi PDev,
We don’t have any support to modify the already saved Primary Key in our EJ2 Grid component since the record tracking for the update, and delete actions will be done based on the Primary key value only. So changing this value will break the default behavior of the Grid Crud action.
Regards,
Pavithra S
Okay, so What i did is. I have added a new Column. and keeping that as Primary Key so I can edit other columns. however while using Toolbar Add button I need to have some integer number as Primary Key value in column. For which I have used "defaultValue" in which I am populating unix timestamp. now, If i add new rows multiple time. It does not change the timestamp and keeps the same value. which is not serving the purpose. Now, I need to have some Auto Incremental value in the column. For which I enabled "isIdentity" property in column as well.
Can you please setup some example. which will have simple ID column with Auto Increment when clicked on Toolbar "Add" button
Figured it out. Added a "BeforeBatchAdd" event. and changed the Primary Key value before that event occurs. it worked and now i have unique values every time user adds a new row. so far everything is working okay.
Hi PDev,
We are glad to hear that you have managed to achieve your requirement.
Please get back to us if you need further assistance.
Regards,
Pavithra S