title: VB.NET Pass values from textbox to datagridview
body: <p>I want to pass values of textboxes to a datagridview using below code.</p>
  
  <pre><code>  Private Sub txtDrCr_Leave(sender As Object, e As System.EventArgs) Handles txtDrCr.Leave
  
      Dim nR As Integer
      nR = TxtList.Rows.Add()
      TxtList.Item("stsno", nR).Value = nR + 1
      TxtList.Item("stAcctCode", nR).Value = txtAccountCode.Text
      TxtList.Item("stAcctName", nR).Value = txtAccountName.Text
      TxtList.Item("stBranch", nR).Value = txtBranchName.Text
      TxtList.Item("stDescription", nR).Value = txtDescription.Text
      TxtList.Item("stAmount", nR).Value = txtAmount.Text
      TxtList.Item("stDrCR", nR).Value = txtDrCr.Text
      cleartextboxes()
  End Sub
  </code></pre>
  
  <p>This code add two lines in the gridview whenever I leave the txtDRCR. I have attached the snapshot as well. Please need kind help. Thanks.</p>
  
  <p><img src="https://i.stack.imgur.com/SMOMi.png" alt="ImageAttached"></p>