I am working on a vb.net project.
Performing a search in the database and throwing the result into the datagridview (dgv), I can get many lines. I need that as I use the vertical scroll bar to down or up automatically change the selection of the line according to the position of the vertical scroll bar.
I tried to use the code below:
Private Sub dgvdados_Scroll(sender As Object, e As ScrollEventArgs) Handles dgvdados.Scroll
dgvdados.Rows(e.NewValue).Selected = True
End Sub
However, without success, is there any way to achieve the result I want?






