Hi there, I have some code below which will make the first displayed row in my datagrid whatever row my mouse is currently clicked on.
Is there a way to change it so that "row" variable could contain a number that I choose so that, say, when I click Button3 it always sets "row" as the tenth row in the datagrid even though no row is selected by the mouse etc?
I tried changing to Dim row as Integer = "10" but I get an error that CurrentRow cannot be set to an integer.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim row As DataGridViewRow
row = JackBennyDataGridView.CurrentRow
JackBennyDataGridView.FirstDisplayedScrollingRowIndex = JackBennyDataGridView.Rows.IndexOf(row)