Datagridview水平滚动条无法正常工作 [英] Datagridview Horizontal scroll bar not working properly

查看:229
本文介绍了Datagridview水平滚动条无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我正在使用数据网格视图来显示数据。我正在将数据从数据表绑定到数据网格视图。数据网格视图中的数据正在显示,但在动态绑定数据时,水平滚动条已启用但无法正常工作。这意味着从左侧移动滚动条时向右,突然它回到左侧。请提出一些建议来解决这个问题。



提前致谢,



Dj

Hi friends,

I am using data grid view for displaying the data. I am binding the data from data table to data grid view .. The data from the data grid view is displaying but while while dynamically binding the data,horizontal scroll bar is enabled but not working properly .That means " when moving Scroll bar from left to right, suddenly it returned to left side ". please suggest some ideas to rectify this issue.

Thanks in advance,

Dj

推荐答案

有两种可能的方法可以解决这个问题。



1.冻结财产

其中一列可能将冻结属性设置为True,对于所有列都应为false。



2. AutoSize和Scrollbars属性

您可以尝试显式设置AutoSize和Scrollbars属性。



否则,ScrollBar应该可以正常工作。
There are two potential options to fix this issue.

1. Frozen property
One of the columns may have frozen property set as True, which should be false for all columns.

2. AutoSize and Scrollbars property
You can try setting AutoSize and Scrollbars property explicitly.

Otherwise, ScrollBar should be working absolutely fine.


尝试使用:



Try using:

dataGridView1.PerformLayout();







渲染DataGridViews是一项代价高昂的操作,因此手动调用布局设置,初始显示除外。



见这里 [ ^ ]



您还应该在表单或控件的Resize Handler中执行Layouting。




Rendering the DataGridViews is a costly operations, wherefore setting the layout is invoked manually, except for the initial display.

See here[^]

You should also Perform Layouting in your Resize Handler of your Form or Control.


这篇关于Datagridview水平滚动条无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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