title: getting the rowindex of a deleted row in datagridview in vb.net
body: <p>following is the issue.</p>
  
  <p>I want to get the row index and column index of the deleted row of datagridview for some calculations and updations.but the error i keep getting is object reference not set to an instance of an object.
  i have written the code in the rows removed event of the data gridview.heres the code.</p>
  
  <pre><code>Try
  
  
      delflag = True
      Dim quant As Integer
      If dgsalesitem.CurrentRow.Cells(0).Value = 0 Then
          quant = dgsalesitem.CurrentRow.Cells(1).Value
      Else
          quant = dgsalesitem.CurrentRow.Cells(0).Value
      End If
      UpdateStock(dgsalesitem.CurrentRow.Cells(2).Value.ToString, dgsalesitem.CurrentRow.Cells(9).Value.ToString, dgsalesitem.CurrentRow.Cells(10).Value.ToString, quant, False)
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Sub
  </code></pre>