It is possible that the pre-bindingsource approach no longer works. My focus has been entirely on getting things to work with the bindingsource.
You can always turn off the IEditableObject support entirely - that might help.
Hello, Mr. Obvious. Long time listener, first time caller. :)
I think I just stumbled upon this issue today. I think my issue is directly related to this. In my BindUI procedure I have these 2 lines of code, as they appear in the Project Tracker sample:
_customer.BeginEdit();
customerBindingSource.DataSource = _customer;
Both of these lines cause the UndoableBase object to fire the CopyStateComplete() event, therefore I'm getting it twice. I also noticed that the AcceptChangesComplete() event is also fired twice.
Are you saying that I should no longer call BeginEdit, ApplyEdit and CancelEdit on my business object if it is bound to a bindingsource?
This is covered in the Using CSLA .NET 3.0 ebook chapter
on Windows Forms.
If you want a top-level Cancel button that resets the form to
its original values, then you need to call BeginEdit() before binding
the object, and then call CancelEdit() or ApplyEdit() after unbinding the
object.
In between those calls, data binding will also call the *Edit()
methods – probably many, many times.
If you don’t have a top-level Cancel button on your form,
then you should never manually call *Edit() except in the helper method
to unbind the object(s) from the bindingsource.
Rocky
Copyright (c) Marimer LLC