Hi I have a datagridview in virtual mode.
Using this code I select multiple rows if they contain a certain string:
Try
For Each row As DataGridViewRow In DataGridView1.Rows
If row.Cells(1).Value.ToString().Contains(TextBox1.Text) Then
DataGridView1.Rows(row.Index).Selected = True
End If
Next
Catch
End Try
This code works to select the rows, but then I am unable to delete any of them using the DEL key. It's almost like the rows have not fired that they are actually selected. If I ctrl-click another row that was not part of the selection group, I can then delete all the selected rows. Does this control click fire come sort of update letting the grid know what rows are selected? How can I solve this issue?