2Way databinding to an Entity.Entity.Entity

Posts   
 
    
Heart5678
User
Posts: 2
Joined: 04-Oct-2007
# Posted on: 04-Oct-2007 18:52:16   

We are considering purchasing your ORM. How do we databind (read and write) a textbox to our Entity.Entity.Entity (in our case completionNote.MaintenanceItem.Vehicle). We have prefetched the related entities and verified they contain the right data. We looked at creating a dynamic list using the "ResultsetFields" and projecting the data into a custom typed class to which we databound to the form controls.

Using:

-LLBLGen Pro v2.5 Final DEMO -Adapter .NET 2.0 -SQL Server 2005 Express

Thank you

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Oct-2007 11:49:39   

Is this a web app or a windows app? Do you want to only bind one field or all/most of the 3rd level entity fields?

We looked at creating a dynamic list using the "ResultsetFields" and projecting the data into a custom typed class to which we databound to the form controls.

Flaten the graph using a TypedList/DynamicList can be a good workaround.

Heart5678
User
Posts: 2
Joined: 04-Oct-2007
# Posted on: 06-Oct-2007 18:53:05   

It's a windows app. I only want to bind one of the 3rd level entity fields. I realize we could use a TypedList but then we would loose the capability to write to the entity fields (as I understand it).

Posts: 254
Joined: 16-Nov-2006
# Posted on: 06-Oct-2007 22:34:21   

Try something like this

vehicleTextBox.DataBindings.Add("Text", completionNote, "MaintenanceItem.Vehicle");

Assuming the completionNote is the main entity and Vehicle is a nested property from the MaintenanceItem property.