Practice the use of DataGridView in VS2015,
A hint that an invalid value occurred after binding a database column exists in the DataGridViewComboBoxCell column
According to the online solution, add the DataError can solve the problem, but the database column is still not bound properly
After studying it, we finally understand the cause of the error and find a solution:
The DataGridViewComboBoxCell column is bound to the data that exists in the column item, otherwise it will be considered an error value, so be sure to populate the column's item before setting the DataPropertyName value of the column, or set the column's binding data in advance. The DataPropertyName value is set at the end, and the same is true in the designer, because the designer's datapropertyname is in front of the data binding.
So the correct solution is to bind the data when the form is loaded, and then set the DataPropertyName.
Error:
Correct method:
Invalid DataGridViewComboBoxCell column values in VS2015 and workarounds for data binding errors DataGridView