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

[Solved] Basic Foreign Key Example

1 Answer 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter Parsons
Top achievements
Rank 1
Peter Parsons asked on 11 Dec 2009, 10:47 AM
Hi,

I'm trying to find a basic example showing how to implement a foreign key lookup in the RadGrid. I have seen several examples of adding a combo to the grid, but can't find any real world examples that link a primary table with a foreign key table.

I have managed to get the lookup combo populated whilst in add/edit mode, but in the main grid it still shows the FK Id instead of the text field, although in trying to get it to work, I now seem to have broken the edit mode.

Basically I have..

[Contacts]
(pk) ContactID
(fk) ContactTypeID
ContactName
ContactNumber
...

[ContactTypes]
(pk) ContactTypeID
ContactType


The Grid columns should be..

ContactType, ContactName, ContactNumber, ...

In Add/Edit mode, ContactType should be a combo populated from the ContactTypes table.

thanks

Cesare

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Dec 2009, 09:58 AM
Hi Anthony,

 To see more information along the lines of the requested functionality, please refer to the following code sample:



Regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Peter Parsons
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or