Gridview滚动条与Gridview中的确切no.of记录不匹配 [英] Gridview Scroll Bar Does not match with the exact no.of records in Gridview

查看:54
本文介绍了Gridview滚动条与Gridview中的确切no.of记录不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我还有一个问题。在我的网格视图中,scorll bar与no.of记录不匹配,如果我在记录完成后滚动gridview,它会给出错误,指出由于对象的当前状态,操作无效。我希望滚动限制到确切的no.of记录,所以一旦记录在最后,我就无法滚动更多。



问候,

Akthar。

Hi,

I have one more problem. In my grid view the scorll bar is not match with no.of records that is if i scroll the gridview after the record is completed it give me the error saying that "Operation is not valid due to the current state of the object". i want the scroll to restrict to the exact no.of records so i cant able to scroll more once the record is in last.

Regards,
Akthar.

推荐答案

如果你启用VirtualMode那么这可能会发生,

将GridView控件的VirtualMode属性设置为False

If you enable VirtualMode then this may Happen,
Set VirtualMode property of GridView Control to False
DataGridView1.VirtualMode = False


其实我的代码有问题。我在代码中多次分配了dgv.rowcount属性,这导致了我的问题。删除其中一行后,它对我有效。
Actually i have some problem with my code. I assigned multiple times the dgv.rowcount property inside my code that causes me the problem. After removing one of the line it works for me.


这篇关于Gridview滚动条与Gridview中的确切no.of记录不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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