CancelEdit not working after navigating to new row

CancelEdit not working after navigating to new row

Old forum URL: forums.lhotka.net/forums/t/3275.aspx


bgilbert posted on Thursday, July 26, 2007

I have a DataGridView bound to a BindingSource which has a SortedBindingList as its data source. On the form, I have an Undo button. In the button I have:

        BindingSource1.RaiseListChangedEvents = False
        BindingSource1.CancelEdit()
        BindingSource1.RaiseListChangedEvents = True

If I dirty a record and immediately click Undo, it correctly reverts the changed value. However, if I dirty a record in the grid, navigate to a new record, and then click Undo, the CancelEdit call does not revert the changed value. I have also tried calling my object's CancelEdit method directly, but this yielded the same result.

Any help is appreciated.

bgilbert replied on Thursday, July 26, 2007

I found a solution to this here:
http://forums.lhotka.net/forums/thread/14779.aspx

but I wonder if more current version of CSLA has addressed this more succinctly.


Copyright (c) Marimer LLC