Show only selected headers in DataGridView
2 answers
in DataBindingComplete () method:
this.dataGridView1.Columns["Age"].Visible = false;
ref: How to Hide Columns in the Windows Forms DataGridView Control
0
a source to share
Personally, I will probably add the columns that I need manually ( AutoGenerateColumns=false
) instead of trying to subtract the ones I don't need.
If it was a class model (not DataTable
), you can do things like set [Browsable(false)]
properties that you never want to see. With . Other than that, just add the columns you want.DataTable
wonder, can not you do something with an unusual DataView
...
+2
a source to share