Hello, I'm trying to pass a variable from main form to child form. The code below is giving me error:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.


VB.NET Code:
  1. list = new List<string>();
  2.  
  3. DataGridViewRow row = programs_dgv.Rows[programs_dgv.CurrentRow.Index];
  4.  
  5. using (InsertData insertData = new InsertData())
  6. {
  7.     list[0] = row.Cells[2].Value.ToString();
  8.     list[1] = row.Cells[3].Value.ToString();
  9.     list[2] = row.Cells[4].Value.ToString();
  10.     list[3] = row.Cells[5].Value.ToString();
  11.     list[4] = row.Cells[6].Value.ToString();
  12.     list[5] = row.Cells[7].Value.ToString();
  13.     list[6] = row.Cells[8].Value.ToString();
  14.     list[7] = row.Cells[9].Value.ToString();
  15.     list[8] = row.Cells[10].Value.ToString();
  16.     list[9] = row.Cells[11].Value.ToString();
  17.     list[10] = row.Cells[12].Value.ToString();
  18.     list[11] = row.Cells[13].Value.ToString();
  19.     list[12] = row.Cells[14].Value.ToString();
  20.  
  21.     insertData._list = list;
  22.  
  23.     insertData.ShowDialog();
  24.     list = insertData.GetValues();
  25.     if (insertData.cancelRequested == true)
  26.     {
  27.         return;
  28.     }
  29. }