question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bound DataGridView with all invisible columns will display first column anyway

See original GitHub issue
  • .NET Core Version: all up to latest (5.0.5)

  • Have you experienced this same bug with .NET Framework?: Yes

Problem description: DataGridView with manual added columns. If your set on all of the columns Visible = false and then set DataSource you’ll get 2 bugs:

  1. First column become visible to user.
  2. If RowHeadersVisible = false and AutoGenerateColumns = false column header will be partially visible.

Snipaste_2021-04-18_11-05-49

Expected behavior: All columns must stay invisible.

Minimal repro: WinFormsCoreTest_Grid_Menu.zip (See Form2.cs)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
RussKiecommented, Jul 22, 2021

I suppose, it may be a strange scenario to have a grid without any columns, hence it wasn’t considered, judging by the comment… ¯\_(ツ)_/¯ The team is currently dealing with other high priority items, but you’re welcome to experiment here, and propose a possible solution.

1reaction
RussKiecommented, Jul 22, 2021

Sounds like a plan 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datagridview shows first column after setting Datasource ...
I have a DataGridView , I set all columns' visible to false. Now I set the DataSource, Kaboom, Guess what? The first column...
Read more >
Win Forms DataGridView doesn't auto generate columns ...
Description Columns in the DataGridView control are not auto generated when data binding if you declare the bound items the "wrong" way.
Read more >
Hide Columns in the Windows Forms DataGridView Control
Learn how to hide columns programmatically in the Windows Forms DataGridView control by setting the DataGridViewColumn.
Read more >
Delete or Hide Columns in DataGrid Control
The deleted or hidden columns still exist in the data source the grid is bound to, and can still be accessed programmatically. They...
Read more >
How can I hide a column value from datagrid?
I'm binding the data to datagrid in vb.net, and the first column is the entity_id, I don't want it to show in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found