@SeanPress, Welcome to Microsoft Q&A, based on your description, you want to handle the NullReference exception when you remove the bottom row.
I recommend that you could check if the DataGridviewCell is nothing first.
Here is a code example you could refer to.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim currentcell As DataGridViewCell = DataGridView1.CurrentCell
If currentcell IsNot Nothing Then
Dim rowIndex As Integer = DataGridView1.CurrentCell.RowIndex
If rowIndex >= 0 AndAlso rowIndex < DataGridView1.Rows.Count - 1 Then
DataGridView1.Rows.RemoveAt(rowIndex)
End If
Else
MessageBox.Show("please don't remove the bottom row")
End If
End Sub
Then, when you remove the bottom row, you will get the message box to tell you that please don't remove the bottom row.
Tested result:
Hope it could help you.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.