So I have a datagrid bound to an OC and I make some changes in the grid and if I click save those changes are saved to the database, but if I click Cancel I want all the changes I made to be canceled and rolled back to the previous state.
Now one way I found of doing this was just resetting my oc by making it repopulate itself from the database but that is resource heavy so was looking for a better solution.
I tried creating another observablecollection of same type and then just setting the old observable collection to the new, but that only works for changes made in the last new row, not for edits and not for if I wanna create 5 new rows and then cancel. Any ideas?