Hi
I have a Parent BusinessBase class which has another child BusinessBase class as a property. If i configure my databinding for this property i get the "Edit level mismatch in CopyState" error.
I have two other properties on the Parent of type BusinessListBase which all work just fine. The only difference being the type of business object the property represents.
I have configured databinding exactly like the samples in the PTracker winforms sample. Could there be any issue with the Undo when have property of BusinessBase type on a Parent BusinessBase class?
Thanks
I am using 3.5.1 and yes I am using managed properties.
The property on the parent is declared like so..
hi again :)
I did tried taking out the overload too but get the same result/error unfortunatly :(
When changing properties for VestingSettings (for example) the parent bindingsource (AwardBindingSource) does not seem to fire either so I am must be setting up something wrong.
My binding setup looks like the following.
Parent (Businessbase) - AwardBindingSource.datasource = MyLibary.Award
Child 1 (BusinessListbase) - TransactionsBindingSource.DataSource = AwardBindingSource
TransactionsBindingSource.DataMember = Transactions
Child 2 (BusinessListbase) - VestingsSettingBindingSource.DataSource = AwardBindingSource
VestingsBindingSource.DataMember = Vestings
Child 3 (Businessbase) - VestingSettingBindingSource.DataSource = AwardBindingSource
VestingSettingBindingSource.DataMember = VestingSettings
I use the rebind method Rocky uses in the PTracker application and copystate error appears on the _award.CancelEdit line
Private
Sub RebindUI(ByVal saveObject As Boolean, ByVal rebind As Boolean) ' disable events Me.AwardBindingSource.RaiseListChangedEvents = False_award.ApplyEdit()
Try_award = _award.Save
Catch ex As Csla.DataPortalExceptionMessageBox.Show(ex.BusinessException.ToString(), _
"Error saving", MessageBoxButtons.OK, _MessageBoxIcon.Exclamation)
Catch ex As ExceptionMessageBox.Show(ex.ToString(), _
"Error Saving", MessageBoxButtons.OK, _MessageBoxIcon.Exclamation)
End Try Else_award.CancelEdit()
End If Finally ' rebind UI if requested If rebind ThenBindUI()
End If ' restore events Me.AwardBindingSource.RaiseListChangedEvents = TrueOk my bad, i had made a mistake on my Child_Fetch method and passed through the SingleCriteria class of the wrong type...The CopyState error has now gone..but...
Any reason or something I can look at specifically to check why when making changes to to the vestingSettings child object that the AwardBindingSource CurrentItemChanged is not fired at all. As VestingSettings is a child i would expect making changes to properties on the child would automatically fire the parent (AwardBindingSource) bindingsource?
Thanks for any help.
IIRC, BusinessBase does not have code to automatically bubble its events to a parent. BusinessListBase subscribes to the BB events and handles the bubbling for you, and BusinessBase has hooks for child BLB's, but not direct child BB's.
- Scott
Can anyone else confirm this and possibly provide suggestions on a workaround? Perhaps i need to implement my business object differently? How do other poeple handle situations where there is a one to one mappings?
I cannot see any reason why the BusinessBase parent class shouldnt handle any events fired on the Businessbase child at all unless I am missing something.
Hello guys!
I am really pulling my hair out on this one...arghhh I just cannot seem to pinpoint why the Parent BindingSource wil not fire when properties on the child is changed.
The child object (of BusinessBase) behaves exactly as I want it too except for the Undo! :(
Any help or suggestions will be greatly appreciated,
Thanks
Copyright (c) Marimer LLC