I use a foreach loop to get data out of my datagridview using the following code.
foreach (DataGridViewRow row in this.dataGridMultiSubmit.Rows)
{
Model = row.Cells[0].Value.ToString();
Module = row.Cells[1].Value.ToString();
Section = row.Cells[2].Value.ToString();
FunctionValue = row.Cells[3].Value.ToString();
NewValue = row.Cells[4].Value.ToString();
DefaultValue = row.Cells[5].Value.ToString();
Description = row.Cells[6].Value.ToString();
MessageBox.Show(Model + Module + Section + FunctionValue + NewValue + DefaultValue + Description);
}
It returns all the rows correctly in the messagebox, but when it run trough all the rows it gives me NullReferenceException was unhandled, how can I fix this?