title: Cannot add rows to datagridview Dynamically
body: <pre><code>DataTable dt = new DataTable();
  DataRow dr = dt.NewRow();
  dt.Columns.Add("name1", typeof(string));
  dt.Columns.Add("name2", typeof(string));
  dt.Columns.Add("name3", typeof(string));
  dt.Columns.Add("name4", typeof(string));
  dt.Columns.Add("name5", typeof(string));
  for (int i = 0; i &lt; 6; i++)
  {
      try
      {
          dr[i] = dt.Rows.Add();
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.ToString());
          return;
      }
  }
  dataGridView1.DataSource = dt;
  </code></pre>
  
  <p>I'm getting error: "Cannot find column 5". If I will change <code>i &lt; 6</code> to <code>i &lt; 5</code>, everything works fine. How to add more than 5 rows? Thank you.</p>