Hi @Kennyqui ,
Because there is an uncommitted new row at the end of Datafridview.
Please use the code above to ensure that the index value is within the deleteable range.
If index >= 0 AndAlso index < DataGridView1.Rows.Count - 1 Then
DataGridView1.Rows.RemoveAt(index)
End If
Hope the code above could be helpful.
Best Regards.
Jiachen Li
----------
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.