I have a problem that I’m not sure how to go about solving. I have a C# app that receives a list of data items from server and they are bound and displayed in a datagrid. The user must then be able to alter them and add or remove items, then commit these changes back to the server. the datagrid will basically function as an “edit data” window from pgAdmin 3 or sequel server or whatever, where the user can edit the database table.
I am able to display the items in the datagrid, but not sure how to keep track of all the changes that are made to the list. When a change is made, the unchanged version of the item must be known as well as the changed version, because the original will need to be deleted and the modified version inserted.
Does anyone know how to do this?
You need to have a view-model which keeps track of the changes. Basically each item will have a current value, but also the most recent value from the DB.