Click here to Skip to main content
14,692,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dgv in a form having a number of rows. I have next and previous buttons to move to the respective rows in the dgv. The next and previous are working correctly. The dvg shows 10 rows at a time. When i select the 11th or the upcoming row we can not see that row. So how can i scroll to that row to see it selected?
I think someone can help me.Thanks in advance..

if i is selected row in dataGridView1 and j is selected column , try :
dataGridView1.FirstDisplayedScrollingRowIndex =i;

dataGridView1.CurrentCell = dataGridView1[j,i];
Try DataGridView.FirstDisplayedScrollingRowIndex.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900