title: Save added rows in DataGridView to database
body: <p>I am trying to save a new added row in a <code>DataGridView</code> to a database. I can't understand which method to call - either <code>gridview1_UserAddedRow</code> or <code>gridview1_RowsAdded</code> (what if it's just one row?).. So far, I've seen that <code>gridview1_RowsAdded</code> executes every time when the form loads.</p>
  
  <p>The <code>DataGridView</code> is bound using a <code>BindingList</code>. </p>
  
  <p>This is how the <code>gridview1_UserAddedRow</code> looks like:</p>
  
  <pre><code>private void dataGridView1_UserAddedRow(object sender, DataGridViewRowEventArgs e)
  {
      int lastRow = dataGridView1.Rows.Count - 2;
      DataGridViewRow newRow = dataGridView1.Rows[lastRow];
      bindinglist.Add(new MyTestClass{ ScheduleId = scheduleId, Name = Convert.ToString(newRow.Cells["Name"].Value),
      Value = Convert.ToString(newRow.Cells["Value"].Value), TestId = testId});
  }
  </code></pre>
  
  <p>Unfortunately, this doesn't work and nothing is inserted. Actually, I think this event is called when a new row is clicked. How else can I insert the newly created row in the database?</p>