确保该行在VB.net的datagridview中可见 [英] ensure the row is visible in datagridview in VB.net
本文介绍了确保该行在VB.net的datagridview中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的应用程序中使用vb.net datagridview当我在编辑第60行时包含超过100行并在完成编辑后绑定网格我需要第60行可见但它移动到第一行
I am using vb.net datagridview in my application when I contain more than 100 row when I edit 60th row and bind the grid after completing edit I need the 60th row is visible but It move to the first row
推荐答案
尝试设置FirstDisplayedScrollingRowIndex,当你做一些应该让你回到起点的东西时,别忘了重置它。
Try setting FirstDisplayedScrollingRowIndex, just don't forget to reset it when you do something that should return you to the beginning :)
// set FirstDisplayedScrollingRowIndex to whatver you want to have visible.
yourGrid.FirstDisplayedScrollingRowIndex = yourGrid.CurrentRow.Index;
注意:currentRow.Index可能会也可能不会确切的代码,但你明白了...
如果这有帮助请花时间接受解决方案。谢谢
NOTE: currentRow.Index may or may not be exact code, but you get the idea...
IF this helps please take time to accept the solution. Thank you
这篇关于确保该行在VB.net的datagridview中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文