tags:

views:

42

answers:

1

Hi,

I have a grid which is binded to a list of objects using LINQ to sql.Now, the grid is editable.So, user can make changes to values in any column.But, if the user wants to cancel,I want to revert changes to the values of objects, and the grid should show original values(without hitting the database).Anyone has done this? How to manage this scenario in LINQ-to-sql

A: 

There should be no need to do anything with the database. Presumably you have bound the grid with a List of objects? One way to do this is to keep two copies of this List. One is bound to the grid and the other can be used to revert everything back to its original state. This would involve no additional trips to the database. However, unless the data in the database is mostly static, it might be a good idea to go back to the database to get fresh copies of all rows.

Randy Minder