[vb.net] Delete a row in DataGridView Control in VB.NET

I am working on DataGridView control in vb.net. I need help you that i want to delete a row in datagrid and only that row deleted who selected. Mean first i select the row then row deleted. So please provide me code that how i select and delete row from DataGridView control in VB.NET

thank

This question is related to vb.net winforms datagridview

The answer is


For Each row As DataGridViewRow In yourDGV.SelectedRows
    yourDGV.Rows.Remove(row)
Next

This will delete all rows that had been selected.


Similar questions with vb.net tag:

Similar questions with winforms tag:

Similar questions with datagridview tag: