Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# DataGridView
Hi..
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..
Posted 5-Aug-10 19:15pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try DataGridView.FirstDisplayedScrollingRowIndex.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

if i is selected row in dataGridView1 and j is selected column , try :
dataGridView1.FirstDisplayedScrollingRowIndex =i;
dataGridView1.CurrentCell = dataGridView1[j,i];
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 7,105
1 DamithSL 5,079
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,617
4 Kornfeld Eliyahu Peter 4,384


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 22 Jan 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100