dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.28k stars 954 forks source link

The DataGridViews overlap after a certain row when they are placed within the FlowLayoutPanel in WinForms #11552

Closed SwathiDhatchanamoorthi closed 3 days ago

SwathiDhatchanamoorthi commented 1 week ago

.NET version

.Net 8.0

Did it work in .NET Framework?

No

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

No response

Issue description

While setting the width and height of the DataGridView based on all its rows and columns and using two DataGridViews in the FlowLayoutPanel, a rendering issue occurred when using more than 1311 records in one of the DataGridViews. It works fine for 1310 records.

image

DataGridView_Overlapping

Steps to reproduce

1.Run the sample.

Observed Behavior: The DataGridView overlapped with the other DataGridView, causing a rendering issue.

elachlan commented 1 week ago

@Olina-Zhang can your team please test this?

Syareel-Sukeri commented 1 week ago

@SwathiDhatchanamoorthi The attached sample project is currently inaccessible due to a permission issue. Could you kindly resend the sample project so we can accurately reproduce and investigate the issue? Thank you.

sethuramkumar commented 1 week ago

@Syareel-Sukeri Please find the sample here: DataGridView_Overlapping.zip

Zheng-Li01 commented 1 week ago

@sethuramkumar thanks the project provided by you.

@elachlan, the issue can reproduce on both .NET Framework from 4.7 ~ 4.8.1 and .NET from 6.0 ~ 9.0.

For .NET: the issue can reproduce when the data more than 1311 records. 11552Core For .NET Framework: the issue can reproduce when the data more than 1490 records. 11552Framework

merriemcgaw commented 3 days ago

@SwathiDhatchanamoorthi This is primarily an issue with the layout of the application and there are many ways you can address this in the application.

SwathiDhatchanamoorthi commented 3 days ago

@merriemcgaw Can you please suggest a solution for this?

merriemcgaw commented 1 day ago

Have you considered a TableLayoutPanel insider the FlowLayoutPanel? You can check on StackOverflow, or use ChatGPT or GitHubCopilot to help you lay things out. Unfortunately, this is not a forum for design and layout questions, so I have to leave this issue closed.