I have a bound DataGridView. A few of the columns are ComboBoxes bound to db lookup tables. They work great as far as displaying/selecting fromthe drop-down data and saving the changes back to the main database table. However, when I close the form I get this error infinite times until I stop debugging:
The following exception occurred in the DataGridView:
System.ArgumentException: DataGridViewComboxCell value is not valid.
To replace this default dialog please handle the DataError event.
Previously, the problem occurred apparently due to AutoSizeColumnsMode being set to AllCells. When I set the property back to "none," the error went away. A blogger instructed me to use the following code in the FormClosing event:
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None
With this code I could set the AutoSizeColumnsMode to AllCells, and the error went away.
But now any design changes I make to the DataGridView bring the error back when I close the form. Even after I reverse the change. I just have to scrap the form and start over. For example, setting the DataGridView property AlternatingRowsDefaultCellStyle to a color brings the error back. The error persists even after I change the property back.
What do I do????
pencilneck