DataBinding with Related Entities

Posts   
 
    
Rogken
User
Posts: 6
Joined: 27-Jan-2006
# Posted on: 29-Jan-2006 18:17:58   

My apologies if this has already been answered before but I'm not really sure of the right verbiage to use when searching the forums. I am trying to databind a collection to a Web Gridview in VS 2005. I have a self servicing model with the following entiies

Company CompanyGuid Name etc...

UserInfo UserInfoGuid CompanyGuid FirstName LastName etc..

I am trying to display in my Gridview all items in the UserInfoCollection plus the Name of the Company referenced by a UserInfo item. Is there a simple way of doing this?? thanks in advance. Brett

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 30-Jan-2006 04:49:03   

Perhaps you might want to have a look at the DetailView control. Its no execatly what you require, but it might help. The url is:

http://www.asp.net/Tutorials/quickstart.aspx

Rogken
User
Posts: 6
Joined: 27-Jan-2006
# Posted on: 31-Jan-2006 15:17:19   

Thanks for the info. From my understanding of DetailsView I don't think this is what I'm looking for. I'm looking to display a listing of the userinfo records while aslo including a column for the company name, which is located in the realted entity. Unless I'm missing something simple during the databind, what I may need to be looking into is a Type List. Brett

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Jan-2006 15:58:34   

If you are fetching an Entity Collection of UserInfo Entities. Then you might need to:

1- Go to the LLBLGen Pro designer, go to your UserInfo Entity properties, then to the FieldsOnRelatedFields Tab. Add the CompanyName to those fields.

2- Specify a prefetchPath for Companies when you are fetching the UserInfo Collection.