'Windows Forms DataGridView view gets distorted when scrolling across the fields
Solution 1:[1]
The rendering problem can be solved by invoking a Refresh() on the grid handling the Scroll event:
Private Sub DataGridView1_Scroll(sender As Object, e As ScrollEventArgs) Handles DataGridView1.Scroll
DataGridView1.Refresh()
End Sub
To avoid flickering when scrolling, I thought it was enough to do a type check
If e.Type = ScrollEventType.EndScroll Then DataGridView1.Refresh()
However, it seems that the EndScroll Type is never assigned due to a bug: DataGridView Scroll event (and ScrollEventType.EndScroll)
Anyway, there is a solution to this problem. You can directly handle scrollbar events to get the correct ScrollEventType: How can I receive the "scroll box" type scroll events from a DataGridView?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

