Question

I have a datagridview in which the first column is a Foreign Key and part of the Primary key of a table (Linq2sql). I use a combobox for selecting a proper Foreign Key value.

The thing is that as soon as I want to edit a (new) row it immediately throws an error "DataGridViewComboBoxCell value is not valid". I assume this is because it's value is required and hence cannot be null (Linq makes it type "int", which does not allow null).

Do I need to supply a default value for the combobox and if so, how/where can I do this?

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top