DataGridView Scroll show columns over others


DataGridView Scroll show columns over others



I have a datagridview, and when i use scrollbar the columns shown over the others, like this image:
here



i have tried DoubleBuffered like that:


DoubleBuffered



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



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- i call that module in Load Event:


Load Event


DoubleBuffer.DoubleBuffered(DataGridView1, True)



but it give me BLACK Cells



so, what is the problem i faced here?





Is this from a customised DataGridView control? That is, is the control you use a custom control that inherits from DataGridView? The only time I have seen things like this is when the control is customised and the _paint and/or _draw events are incorrectly implemented or something is missing from them
– JayV
Jun 29 at 9:59


DataGridView


_paint


_draw





i only customized the rows align and the cells colors with no events, just from properties.
– Point_Systems
Jun 29 at 10:10









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV