Is it possible to develop a user control that manages, say a Contact Business Object and then use that control on a form and at runtime automatically bind the control to the appropriate Contact Business Object?
Consider this data layout:
(1) Supplier Business Object with Name, Start Date (etc) and Contact properties.
(2) Vendor Business Object with Name, Start Date, Credit Limit (etc) and Contact properties
(3) Contact Business Object with Phone, Fax, Email properties, all backed by the Contact table.
In both Supplier and Vendor, Contact is a Foreign Key relationship to the Contact Business Object
The Contact BO holds the contact information for Supplier and Vendor.
My goal is to create a User Control that manages the Contact BO, and be able to drop it on either the Supplier or Vendor maintenance forms and wire it so that it would work the same as if I had built the form using the ControlBindingManager and dropped the nested Contact properties onto the form.
It seems to me this should be possible, has anyone done this?
Can someone provide some examples?
I have studied the tutorial "Composing Forms with User Controls", which is helpful, but does not deal with the situation I describe.
Any help/ideas would be most helpful.
TIA,
Mark