滚动到datagridview中的选定行 [英] Scroll to the selected row in datagridview

查看:118
本文介绍了滚动到datagridview中的选定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我有一个行数dgv。我有下一个和前一个按钮移动到dgv中的相应行。下一个和上一个正常工作。 dvg一次显示10行。当我选择第11行或即将到来的行时,我们无法看到该行。那么我如何滚动到该行才能看到它被选中?

我想有人可以帮助我。提前谢谢..

解决方案

如果我在dataGridView1中选择了行并且j是选中列,请尝试:

 dataGridView1.FirstDisplayedScrollingRowIndex = i; 



 dataGridView1.CurrentCell = dataGridView1 [j,i]; 


尝试 DataGridView。 FirstDisplayedScrollingRowIndex

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..

解决方案

if i is selected row in dataGridView1 and j is selected column , try :

dataGridView1.FirstDisplayedScrollingRowIndex =i;


dataGridView1.CurrentCell = dataGridView1[j,i];


Try DataGridView.FirstDisplayedScrollingRowIndex.


这篇关于滚动到datagridview中的选定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆