title: AddNew(), problems deleting this row
body: <p>I have a DataGridView bound to a BindingSource. I then have a Button to add a new record:</p>
  
  <pre><code>Private Sub btnNew_Click(sender As Object, e As EventArgs) Handles btnNew.Click
      _bsStaff.AddNew()
  End Sub
  </code></pre>
  
  <p>This does create a new row, also following it with the "next new/blank" row. This works fine, except if I immediately press my Delete button to try and remove this newly added row:</p>
  
  <pre><code>Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
      If MessageBox.Show("Delete staff member record?", "Confirm", MessageBoxButtons.YesNo, _
                         MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
          _bsStaff.RemoveCurrent()
      End If
  End Sub
  </code></pre>
  
  <p>This removes the new row, but also the one before it!</p>
  
  <p>I tried adding a line before RemoveCurrent, <code>_bsStaff.EndEdit()</code> and also <code>If _bsStaff.Position + 1 = _bsStaff.Count Then</code>, but the behaviour persists.</p>
  
  <p>Could someone explain this behaviour and offer a solution?</p>
  
  <hr>
  
  <p><strong>Added</strong>: I thought I had it beat with this code, checking the row state:</p>
  
  <pre><code>Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
  
      Dim state = CType(_bsStaff.Current, DataRowView).Row.RowState
      Select Case state
          Case DataRowState.Added
              _bsStaff.RemoveCurrent()
          Case DataRowState.Deleted
              MessageBox.Show("Row already deleted.", "Delete")
          Case DataRowState.Detached
              _bsStaff.CancelEdit()
          Case DataRowState.Modified
              If MessageBox.Show("Delete staff member record?", "Confirm", MessageBoxButtons.YesNo, _
                                 MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
                  _bsStaff.RemoveCurrent()
              End If
          Case DataRowState.Unchanged
              If _bsStaff.Position + 1 &gt; _bsStaff.Count Then
                  'do nothing, the new row
              ElseIf MessageBox.Show("Delete staff member record?", "Confirm", MessageBoxButtons.YesNo, _
                                 MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
                  _bsStaff.RemoveCurrent()
              End If
          Case Else
              'do nothing
      End Select
  End Sub
  </code></pre>
  
  <p>However, looking at the screenshot,</p>
  
  <p><a href="https://i.stack.imgur.com/eBGhp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eBGhp.png" alt="enter image description here"></a></p>
  
  <p>when I click into the new row, and then click my button, it is in an Unchanged state, but it is the previous row that has the current record pointer (and that the Unchanged state probably refers to), it is this row that will be deleted.</p>
  
  <p>Essentially, I think I need a way to detect that the new row has just been clicked into, but nothing has been typed, so that I can abandon the attempt to delete.</p>