dotnet / dotnet/winforms

DataGridView refresh problem after scrolling/resizing

Open
#9,207 6 comments 0 reactions 0 assignees View on GitHub
area-controls-DataGridView area-HDPI
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### .NET version

.NET 7.0

### Did it work in .NET Framework?

Yes

### Did it work in any of the earlier releases of .NET Core or .NET 5+?

I didn't try.
I directly migrate from .NET framework 4.8 to .NET 7.

### Issue description

Datagridview does not render the cells correctly after scrolling. It is in **virtual** mode.
There was no problem when I was using .NET framework 4_8.
![datagridview_issue](https://github.com/dotnet/winforms/assets/106665359/84aab4f0-fd4c-4607-92ed-f5c3ef8e3d6b)
Issue happens when using **High dpi monitor** and **HighDpiMode=DpiUnawareGdiScaled**.
Issue does not happen when using **High dpi monitor** and **HighDpiMode=DpiUnaware**.
Issue does not happen when using **normal monitor** whether **HighDpiMode** is **DpiUnaware** or **DpiUnawareGdiScaled**.

### Steps to reproduce

Create a datagridview in virtual mode. Make it's size small, so that both horizontal and vertical scrollbars are visible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.