Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
This looks like an instantiation order problem. Most likely, the BBS's BusinessObject property is not being set within the InitializeComponent of the UserControl before the Binding is added to the textbox's DataBindings collection. There's not a way to force the textbox to wait until the BO has been set to add the binding. You can, however, create an inherited BusinessBindingSource and in it's constructor add an instance of the business object that you need. The business object would be contained within the BBS, so that might cause some problems if you want to handle BO events on the user control (you would just have to add the handlers manually...). Another option would be to copy the designer code for the creation of the bindings and move the code out off the .designer.* file and into the constructor of your user control after InitializeComponent() is called. This would force the textboxes to wait until the BusinessObject has been set before binding to the BBS.
|