DataGridView Scroll显示其他列 [英] DataGridView Scroll show columns over others

查看:109
本文介绍了DataGridView Scroll显示其他列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagridview,当我使用滚动条时显示在其他列上的列,如下图所示:


i已尝试  DoubleBuffered   like
表示:

i have tried DoubleBuffered like that:


1-我创建了一个名为"DoubleBuffer.vb"的模块

1- i created a module named "DoubleBuffer.vb"


2-我在其中添加该代码:

2- i add that code in it:

Imports System
Imports System.Reflection
Imports System.Windows.Forms
Module DoubleBuffer
    Public Sub DoubleBuffered(ByVal dgv As DataGridView, ByVal setting As Boolean)
        Dim dgvType As Type = dgv.[GetType]()
        Dim pi As PropertyInfo = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance Or BindingFlags.NonPublic)
        pi.SetValue(dgv, setting, Nothing)
    End Sub
End Module

3-我将该模块称为  加载
事件:

DoubleBuffer.DoubleBuffered(DataGridView1, True)




但是它给了我BLACK Cells

but it give me BLACK Cells


所以,我遇到的问题是什么?

so, what is the problem i faced here?


推荐答案

您不需要为此数量的记录进行双缓冲,其他内容必须继续导致这些问题,而不仅仅是将数据加载到DataGridView。
You should not need double buffering for that amount of records, something else must be going on to cause these issues other than simply loading data into your DataGridView.


这篇关于DataGridView Scroll显示其他列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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