I have a combobox in my WPF app that is databound to my list of objects in my View Model. When the user makes changes to the selected object and then selects another item before saving, I need to clear the changes made.
I thought I could use dataContext.GetChangeSet().Updates.Clear() but for some reason the collection is read-only.
I've also tried to use dataContext.Refresh but this doesn't work either as the object doesn't exist in the database, I created it manually from an SP.
Please help. thanks.
Your best bet is probably to re-query into a separate data-context. You can negate an insert (from the change-set) by using DeleteOnSubmit
(and the reverse), but I'd rather not, myself.