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

Foreign Key Column

2 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Predrag
Top achievements
Rank 1
Predrag asked on 28 Apr 2015, 07:06 AM

I have the following columns in my bindingsource BookID, Name, Price, StatusID. StatusID is a foreign key.

Another table has the following columns StatusID, Status_Name.

I want Radgridview to contain the following columns: Name, Price, Status_Name. How can I do that? I cann't do that by a query because I will loose update capabilities of my tableadapter. Should I do that by templates? How can I accomplish this?

Thanks! 

 

2 Answers, 1 is accepted

Sort by
0
Predrag
Top achievements
Rank 1
answered on 28 Apr 2015, 07:41 AM
I found a solution by combobox column.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Apr 2015, 07:49 AM
Hello Predrag,

Thank you for writing.

Indeed, the GridViewComboBoxColumn is the appropriate solution for this case. Please, make sure that the GridViewComboBoxColumn.FieldName property is set to "StatusID". Additionally, it is necessary to set the ValueMember property to "StatusID" as well because the grid cell belonging to this column contains the respective Id.

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
GridView
Asked by
Predrag
Top achievements
Rank 1
Answers by
Predrag
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or