0

How can I display the value of a foreign key into a data grid view instead of its ID value? I'm binding the data grid view directly to database using data-source ..

DGV

And at run time i m getting an error: for species type column.

ExceptionMsg

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Develop4Life
  • 7,581
  • 8
  • 58
  • 76
  • Can't tell without seeing the code. However, [this](https://stackoverflow.com/questions/5778621/set-selected-items-for-datagridview-combobox-failed), [this](https://stackoverflow.com/questions/92035/set-selected-item-on-a-datagridviewcomboboxcolumn), and [this](https://stackoverflow.com/questions/42244576/datagridviewcomboboxcell-how-to-set-selected-value-when-adding-a-row) should help. –  Dec 10 '19 at 14:36
  • 1
    Wire up the grid’s `DataError` event and check the error message. From the picture of the error I am confident that the data has an item that does not belong to the combo box’s items list (species_type_id). How are you adding the items to the `DataGridViewComboBoxColumn`? – JohnG Dec 12 '19 at 06:02

0 Answers0