title: adding multiple items one by one in datagridview in c# window form
body: <pre><code>private void btnSave1_Click(object sender, EventArgs e)
  {
     foreach (DataGridViewRow dgvr in ProductAddGridView.Rows)
      {
          dgvr.Cells[0].Value = productIDTextBox.Text;
          dgvr.Cells[1].Value = productTypeIDComboBox.Text;
          dgvr.Cells[2].Value = companyIDComboBox.Text;
          dgvr.Cells[3].Value = productPurchaseRateTextBox.Text;
          dgvr.Cells[4].Value = productQtyTextBox.Text;
          dgvr.Cells[5].Value = productDescriptionRichTextBox.Text;
          dgvr.Cells[6].Value = Convert.ToString(Convert.ToUInt32(productQtyTextBox.Text.Trim()) * Convert.ToDecimal(productPurchaseRateTextBox.Text));
       }
  }
  </code></pre>
  
  <p>I am trying to add multiple products one by one in a datagridview before saving it to database. But whenever I add a row in datagridview second time, the first row gets replaced by the second row -- it only works for single row addition.</p>