var gridToXml=new ClassVivod[dataGridView1.Rows.Count]; for (int i = 0; i < gridToXml.Count(); i++) { gridToXml[i].Key = dataGridView1.Rows[i].Cells["Key"].Value.ToString(); gridToXml[i].ValueXML_1 = dataGridView1.Rows[i].Cells["Russian"].Value.ToString(); gridToXml[i].ValueXML_2 = dataGridView1.Rows[i].Cells[comboBox1.Text].Value.ToString(); }
At the time of assignment an error occurs, the object reference does not indicate an object instance.