Anthony
Anthony

Reputation: 97

DataGridView not visible on form Windows 10

I had an issue with a DataGridView not being shown on a Form that was initialised from another Form on Windows 10 in Release mode. The issue is not present when debugging code in Debug Mode. I even tried turning off optimization. It took me 2 days to work out the issue so im making this with the hope it helps someone else facing this issue as there it NOTHING online for this specific issue.

Scenario (Issue ONLY occurs in this scenario in Release built code)
Form1 - Click button to show Form2
Form2 - Has a DataGridView which is not loaded/shown on the form

Upvotes: 0

Views: 176

Answers (1)

Anthony
Anthony

Reputation: 97

If ColumnHeadersHeight is set to anything other than default (21) on FormLoad then the DataGridView will not be shown on the form.

You can change the ColumnHeadersHeight property AFTER the form has loaded.

Upvotes: 1

Related Questions