Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
How do I handle concurrency when editing grid data?

I am looking for a solution to handle concurrent editing of data in a grid. The web application I am working on will run on multiple computers, where more than one person are able to edit the same record in the database. 

It is an ASP MVC application, using wrappers for igGrid and other Ignite UI components (19.1).

The grid uses updating in cell mode and a save changes action method in my controller based on your development guide and API. The grid data is use a viewmodel object, not the actual database object.

Now, when save changes is fired, how can I verify that the object I am editing is based on the same version of that object in the database? As far as I have seen, only edited fields are sent in the transaction, so there is no way to validate the other fields of that object as these are not available. And since the action method gets the object from the database for each field it needs to update, as in your code example, it will get the most recent version, which may have been changed by another user while the current user was editing it.

So what are my options in this case?

Can I include fields (such as all editable fields or one specific hidden field (timestamp)) not edited in the save changes action from the client to the server? Is there any way to extend or modify the igGrid.("saveChanges") function in order to make this possible?

In my controller action method I will then need to determine if the data I am updating is based on the current database data or not.

Do I need to go for a different soultion?

Best regards

Fredrik Walka