Edit Level mismatch with simple Root + BLB child, all managed properties

Edit Level mismatch with simple Root + BLB child, all managed properties

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


rsbaker0 posted on Tuesday, December 02, 2008

I was implementing a new simple set of objects, a root with a BLB child list, and everything is managed, no lazy loading, etc.  This is with CSLA 3.5.

I'm getting an EditLevel mismatch because the child object has BindingEdit=true even though I have unbound the data source.

I'll continue to diagnose, but more interesting is that the designer wants to create 2 binding sources when you drag a child collection from a root data source on to a form. So, you have one binding source for the root, and a separate binding source for the child list. However, the datasource for the child list binding source references the root binding source and specifies the property name for the list. Does CSLA support this model? I'm just asking because of previous posts suggesting that an object could only be participating in one binding source at a time.

RockfordLhotka replied on Tuesday, December 02, 2008

It is fine to have a parent-child (master-detail) relationship between bindingsoure objects.

Each CSLA object is only bound to one bindingsource, not both.

The trick is that you must unbind the child bindingsource, then unbind the parent bindingsource. The ParentChildGrandchildTest sample app in the samples download (3.6) illustrates this.

Also, the new CslaActionExtender control in 3.6 automates the process pretty much completely.

rsbaker0 replied on Tuesday, December 02, 2008

Thanks, I missed the child binding source unbind -- I should have double checked in ProjectTracker first.  How naive of me to think that setting the parent binding source to null would also detach any directly linked binding sources... ;)

Copyright (c) Marimer LLC