Why do I get "DataGridViewComboBoxCell value is not valid." ?

Marc Graham 26 Reputation points

I read a .csv file and use each line as an entry to a DataGridView. I've been doing this for years. I just updated to w11 from 10 and it crashes with the subject exception error message on the additon of the second row. If I load two, one record files, both work. (There is a combo box column in the DGV.)

Here's the relevant code.

DataGridViewRow yydgv = new DataGridViewRow();
yydgv.CreateCells(dgv, vv);  // vv is an array of strings
yydgv.Tag = SortProvider.GetRowTag(true);
dgv.Rows.Add(yydgv); // this is where the crash happens on the 2nd time through the loop

Any help, Please!! I'm desperate.

Microsoft Technologies based on the .NET software framework.
3,345 questions
{count} votes