I have a DataGridView control in a winforms app that I'm working on.
The DataSource is set to IQueryable that I get from our service layer:
dataGridView1.DataSource = (from c in _customerService.GetAll() select c);
In the example I'm working on, I have a cancel button that I wish to use to revert changes. If they hit cancel, I do not call DataContext.SubmitChanges() and I close the form. However, when I re-open the form, the data displayed in the DataGridView reflects the changes that I made on the previous form prior to hitting cancel.
When I close the program and run it again, everything's fine. So I believe that I'm changing data in the collection that is bound to the DataGridView.
Surely there is an obvious solution to this and my ignorance of winforms is showing (this is my first stab at anything winforms.)
Any suggestions for reverting changes to a datagridview?
Thanks for the help!
Ian