DataGridView selected row in top

Hello Expert,

I select an row in the DataGridView

e.g. Me.DataGridView1.CurrentCell = DataGridView1.Rows(nRow).Cells(0)

But I also want that this row is shown on the first line in the grid

I can do that by scrolling myself, but should be done automatically.

Regards,

dgb
dgbAsked:
Who is Participating?
 
vadim63Commented:
Me.DataGridView1.CurrentCell = DataGridView1.Rows(nRow).Cells(0)
Me.DataGridView1.FirstDisplayedScrollingRowIndex = nRow
0
 
dgbAuthor Commented:
It works!

Thanks vadim63
0
 
vadim63Commented:
Good luck! Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.