I have a situation where I'm trying to get some code reuse in my GUI, by using a custom user control. As an example...I have two forms, one to display people and a second to display companies. Both forms have a detail section to display addresses. My idea was to create a custom control to display addresses, and add it to both the person form, and the company form.
Both of the forms have a BindingSource object. The address user control has a BindingSource as well.
Me
.ucAddresses.AddressesBindingSource.DataSource = Me.PersonBindingSourceMy problem is that in the custom user control, I need to add an item to the Person.Addresses collection. It won't let me, because there is no public constructor. I was expecting it would use the AddNewCore() function, but that doesn't appear to be the case.
cur = Me.AddressesBindingSource.AddNew()
Does anyone have any suggestions on how I should deal with this problem?
My bad.
On the form I was testing, the line....
Me.ucAddresses.AddressesBindingSource.DataSource = Me.PersonBindingSource
was not getting executed.
Thanks,
Jeff
Copyright (c) Marimer LLC