Mapped relation fields not showing up in designer

Posts   
 
    
Dusty
User
Posts: 24
Joined: 19-Feb-2008
# Posted on: 23-Feb-2008 00:39:10   

I am testing the demo against a large database.

I am creating data sources from the objects in my compiled LLBLGen library and dragging the controls onto my forms.

I have run into a few entities that have related fields that don't show up in the data source view. Others work fine.

The related fields are accessible in the entity. They just don't show up in the designer and so I am unable to bind to them.

Any ideas?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Feb-2008 03:02:29   

Hi Dusty,

If I understand ok, you are using WinForms, right?

When you say related fields, do you mean "Field mapped on relation" or "Field mapped on related field"? (please see LLBLGenPro Help - Using the designer - Adding and editing entities - Editing an entity to figure out the difference).

David Elizondo | LLBLGen Support Team
Dusty
User
Posts: 24
Joined: 19-Feb-2008
# Posted on: 23-Feb-2008 04:19:13   

Yes. This is a WinForm project. And I meant 'Field mapped on relation'.

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 23-Feb-2008 20:53:02   

Could you please digg up a little and try to give us more information so we can help you better?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Feb-2008 19:41:27   

Dusty wrote:

Yes. This is a WinForm project. And I meant 'Field mapped on relation'.

A field mapped on relation is an object referencing another entity. Could you explain what are you doing or expecting. Did you read the Databinding section of the manual?

Cheers

David Elizondo | LLBLGen Support Team
Dusty
User
Posts: 24
Joined: 19-Feb-2008
# Posted on: 25-Feb-2008 05:34:05   

Here is what I was trying to do.

I have an entity called 'VendorPartEntity'. It has a primary key of 'VendorID' + 'PartNumber'. Both 'VendorID' and 'PartNumber' are also foreign keys to tables 'Vendor' and 'Part' respectively.

I am able to bind to the PartNumber property on the 'VendorPartEntity'. I would also like to bind a 'TextBox' to the 'Description' property of the 'PartEntity' contained in the 'VendorPartEntity' object. So I would have a textbox 'partDescriptionTextBox' that was bound to 'vendorPartEntity.Part.Description'.

I am able to bind to EntityCollections contained in an entity just not 'Fields on relations'.

I also realized that I can create a 'Field on related fields' property in the LLBLGen designer.

Is that the only way?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 25-Feb-2008 10:54:36   

Use a FieldMappedOnRelatedField and if you are using the Adapter model, then you will need to use a prefetchPath to PartEntity at runtime to load it's value.