Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

WinForms: Binding to a single Child BO / BindingSource

$
0
0
Hi,

Usually, when a BO has a ChildList, you can have 2 BindingSources on the Form, one for the Parent BO, and one for the ChildList. From there you bind your controls to either the Parent BO or the Child BO.

I'm trying to do the same, but with a single Child BO, and the Windows Forms Designer won't let me chose the Child BO through the Parent BindingSouce as it would if it were a ChildList property. What I mean is that the Form Designer will let me chose the Parent BindingSource as the DataSource for the Child BindingSource, but it doesn't show the Child Property in the DataMember list, so I can't setup the Child BindingSource properly. If I manually enter the name of the Child Property, then I get a runtime crash.

The Child Property is declared as follows on the Parent BO:

private static PropertyInfo<Item> ItemProperty = RegisterProperty(new PropertyInfo<Item>("Item", "Item"));

        public Item Item
        {
            get { return GetProperty(ItemProperty); }
            set { SetProperty(ItemProperty, value); }
        }

where Item is a class derived from BusinessBase.

Has anyone come across this before ?

Thanks for any pointers you may have.


Viewing all articles
Browse latest Browse all 764

Trending Articles