How to hide column of DataGridView when using custom DataSource?

前端 未结 7 1663
时光取名叫无心
时光取名叫无心 2020-12-08 20:07

I have a small app in c#, it has a DataGridView that gets filled using:

grid.DataSource = MyDatasource array;

MyClass hold the structure for the

7条回答
  •  -上瘾入骨i
    2020-12-08 20:12

    Set that particular column's Visible property = false

    dataGridView[ColumnName or Index].Visible = false;

    Edit sorry missed the Columns Property dataGridView.Columns[ColumnName or Index].Visible = false;

提交回复
热议问题