In our desktop application,we bind grids to data.Now,for example a grid is showing records of customers.The user can edit any record,and click save.Instead of save, he can click cancel too.I am able to get originalstate of all objects and show their values in the grid.But,I have not found a way to cancel\clear updates collection as it is readonly.What happens is, that user again say makes some changes, and clicks save,earlier updates collection still exists.
Asked
Active
Viewed 177 times
1
-
duplicate of http://stackoverflow.com/questions/259219/how-can-i-reject-all-changes-in-a-linq-to-sqls-datacontext – Andre Gallo Nov 24 '09 at 06:32
-
but it does not address the question.THe collection is readonly,so clear does nto work – dude Nov 24 '09 at 06:39
1 Answers
0
I have run into this same issue. I believe the only effective way to do this is to discard your original data context object and create a new one.
Randy

Randy Minder
- 47,200
- 49
- 204
- 358