This is a migrated thread and some comments may be shown as answers.

entitydatasource with foreign key

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Dhingra
Top achievements
Rank 1
Paul Dhingra asked on 14 May 2010, 09:27 PM
This seems like a really basic question, and I feel a little silly for asking...

I have an entity model, including two tables:

Table: Products
Product ID - PK
Code
Description
CategoryID - FK

Table:  Categories
CategoryID - PK
Code
Description

Using a RadGrid with an EntityDataSource control, I can't seem to figure out how to have the grid display a list of products that includes the Product Code, Product Description, and Category Description. 

Again, I feel like I'm missing something very simple, so I apologize - I've done lots of searching and have found examples for hierarchies, combos in edit mode, etc - all I'm looking to do at this point is just display the fields. 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 15 May 2010, 03:14 PM
Hello Paul,

By using EntityDataSource it is a bit tricky. You should set Include property in order to force the loading of related entities. For your convenience I am attaching sample application.

Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Paul Dhingra
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or