Any example of Parent with one Editable child?

Any example of Parent with one Editable child?

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


reagan123 posted on Friday, August 28, 2009

Hello everyone,
I've been using CSLA 3.0.4 for a bit now and have always had root objects that contained child collections.  I finally have my first case where I need to have a root object with one single editable child object.  Is there any discussion or samples that have this scenario?

Does the child object change if it is not going to be part of a collection?  I'm just trying to make sure I understand this all a bit better before moving forward.

Any insight greatly appreciated.

Tom_W replied on Friday, August 28, 2009

Hi there

I think, in essence, this works as you would expect.  However, there is a catch with single child objects, which is that .net data binding in combination with CSLA does not play all that nicely with single child objects.  This definitely applies in WinForms, not sure about any of the other UIs.

It's a while since we tried this, but we spent a lot of time trying to get it all working and never succeeded completely.  IIRC somewhere there is a post where Rocky explains .net's problem with data binding a single child.  We never got it working and in the end switched to getting rid of the child object and incorporating its data into the parent object instead. 

There is a post I started here on this:  http://forums.lhotka.net/forums/thread/33777.aspx

(reading back through that post I notice that Andy suggested the solution we eventually adopted... thank you Andy!)

reagan123 replied on Friday, August 28, 2009

Thanks you for the reply.  Yeah... I found some of those posts and that is what kind of made me want to post.  I was hoping there may be some "newer" answers or approaches.

I appreciate the feedback and link.

Thanks.

Copyright (c) Marimer LLC