StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Binding a control to a Business object NOT on...Expand / Collapse
Author
Message
Posted 08/08/2006 6:39:08 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 02/04/2008 8:43:02 AM
Posts: 176, Visits: 1,519
Is there a way to get winforms controls to bind to a business object that is NOT on the form?

I have a class that has several BO's as properties and the class manages loading the BO's with the requested data and provides functionality to maintain the required table relations.  Is there a better way of doing this?  Maybe a view based on the underlying tables?  If this is the best option, would we need to used the DDT to set a primary key field so that the business object can update the view?

Thanks for any input.

Post #2133
Posted 08/09/2006 8:37:19 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
You can programmatically set the business object that is bound to a control at runtime.  So, if you expose the business object as a public property on your class, you will be able to bind to it at runtime by setting the BusinessObject property on the control to the property returned by your class.  The only difference between binding at runtime and binding at design-time is that you will need to manually call Refresh() on the business object after you setup the binding so that the value is pushed out the first time.

I think the way you have it configured is probably your best bet.


www.bungie.net
Post #2136
Posted 08/09/2006 11:48:43 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 02/04/2008 8:43:02 AM
Posts: 176, Visits: 1,519
Thanks Ben,  works great.
Post #2139
Posted 08/09/2006 12:51:52 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
No problem


www.bungie.net
Post #2140
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:02pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.