S
Sam Martin
Hi all,
I've sorted out binding to and from my business entities, however....
Pulling data from the business entities is easy using the
<control>.DataBindings.Add(..) method. These bindings take care if
themselves from UI.
Pushing data from these objects was a bit more problematical, but discovered
that the data binder listens for <PropName>Changed events, and that it only
takes one property/event to trigger an update for the bound data object. To
create a generic "push" method in my business entities, I declared a
property in my base entity class and a method (.e.g. UpdateBound()) that
sets the common property (i.e. Entity.Data) to be Entity.Data (itself) - and
in the Data property, on the set() method i fire a DataChanged event which
the data binder handles and refreshes the bound controls for the data
object.
As long as the property in the base entity is bound to a control's property
it work fine.
This is my problem, in some cases I will need to manage mutiple business
entities from within a form so I need to know if it's possible to create
like a custom bindings for my business entities. for example bind property X
of object A to property Y of object B ?
TIA
Sam
I've sorted out binding to and from my business entities, however....
Pulling data from the business entities is easy using the
<control>.DataBindings.Add(..) method. These bindings take care if
themselves from UI.
Pushing data from these objects was a bit more problematical, but discovered
that the data binder listens for <PropName>Changed events, and that it only
takes one property/event to trigger an update for the bound data object. To
create a generic "push" method in my business entities, I declared a
property in my base entity class and a method (.e.g. UpdateBound()) that
sets the common property (i.e. Entity.Data) to be Entity.Data (itself) - and
in the Data property, on the set() method i fire a DataChanged event which
the data binder handles and refreshes the bound controls for the data
object.
As long as the property in the base entity is bound to a control's property
it work fine.
This is my problem, in some cases I will need to manage mutiple business
entities from within a form so I need to know if it's possible to create
like a custom bindings for my business entities. for example bind property X
of object A to property Y of object B ?
TIA
Sam