I have a bindingsource bound to a datagridview. I delete a row using bindingsource.removecurrent, and then I try to restore the row using bindingsource.canceledit. That doesn't work (even though it does work when removing and restoring rows in a listbox), so I tried calling RejectChanges on the underlying datatable and that worked. So why doesn't Canceledit work. I literally put the statements back to back for testing purposes and it still won't work.

CancelEdit or RejectChanges
RichardM
I have a related question: If I work with (DataRowView)BindingSource.Current, and RejectChanges its Row, then does it matter whether the operation before was EndEdit, CancelEdit or none What happens to the DataRowView after the RejectChanges
BruceM
To understand these functionalities better you have to understand how datarows work. A datarow can be made up from mutiple datarows. The one you are seeing in your datagrid is the current version of the row. But there maybe more versions of the row in memory.
CancelEdit is part of BeginEdit, EndEdit and CancelEdit methods. These methodes are used for user input on a row level. E.A. when a user presses CTRL+Z when editing a textbox value these methods get called.
AcceptChanges and RejectChanges have to do with the RowVersions. When AcceptChanges is called the last row version becomes the new Original and all other versions of the row are destroyed. Vica versa with RejectChanges(), then all row versions but the original are destroyed.
oineh
It does not matter when you call any of the routines.
BeginEdit, EndEdit and CancelEdit are for transactional properties of the datarow on a single edit base.
The AcceptChanges and RejectChanges are for controlling the current version of the row.
Those 2 are fundamentally different and as far as I know have no relation to one another.