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:
- First column become visible to user.
- If
RowHeadersVisible = false
andAutoGenerateColumns = false
column header will be partially visible.
Expected behavior: All columns must stay invisible.
Minimal repro:
WinFormsCoreTest_Grid_Menu.zip (See Form2.cs
)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Sounds like a plan 😃