StrataFrame Forum

Exposing databinding of SF controls within a user control

http://forum.strataframe.net/Topic8964.aspx

By Greg McGuffey - 5/22/2007

What is the best way to expose the data binding of SF controls embedded within a user control?



E.g. a user control that contains several SF textboxes to hold an address: a couple of address lines plus city, state and zip textboxes. When I drop the address user control onto a form, what is the best way to expose the bindings on these five text boxes, so they can be bound via the user control?
By Chan - 5/22/2007

Hi,

Currently what I did is, I have put textboxes in a user control which country and states BO as baseclass. Then, I subclass this user control, and place BO such as employeeAddressBO and set data binding. Drop the user control with data binding to form and set BOTranslation.

It is the simplest way I can find at this moment. If you have any better solutions, please advice.

Thank you

By Greg McGuffey - 5/22/2007

This seems like a excellent idea if you know what the bindings will be when the control is built (i.e. you know it will bind to an instance of the employeesAddressBO).



The user control I'm currently building is more generic...I have no idea what the binding will be.
By Chan - 5/23/2007

Hi,

I used to post similar question here, http://forum.strataframe.net/Topic8396-7-1.aspx

However, I have no time to explore for it yet.

By StrataFrame Team - 5/23/2007

If you don't know what you'll be binding to, then you'll probably need to add a property to your UserControl to accept a business object.  Then, in the load of the user control, you can configure the bindings manually dependant upon the type of the business object that you set.