I am using CSLA 3.02 and experiencing a problem. When implementing a Cancel Button subroutine as stated in the Using CSLA.Net Version 3.0 page 120, unbinding any of the ChildBindingSources does not undo the add, delete or editing Child item changes of that respective ChildCollection. When unbinding the ParentBindingSource, the undo works fine on attributes in the Parent object, but ChildCollection attributes remain unchanged.
We have a ParentObject with 3 ChildCollectionObjects attached. The ParentObject is bound to ParentBindindSource component and each ChildBindingSource is bind to ParentBindingSource and its DataMember set to proper childcollection.
Any ideas? Thanks in advance.
You need to follow the pattern used in the edit forms in PTWin, which is slightly more complex than the code in the ebook.
Specifically, before binding your objects you need to manually call BeginEdit() on the root object.
Then, after unbinding your objects you need to manually call CancelEdit() on the root object. Or ApplyEdit() if the user clicked the Save button.
Copyright (c) Marimer LLC