HI,
Ive got ( 10 ) gridview colums i want to hide.
Now i do it like this: But is there a faster way i could do this with less code ?
- customersDataGridView.Columns["CustomerNumber"].Visible = false;
- customersDataGridView.Columns["FirstName"].Visible = false;
- customersDataGridView.Columns["lastName"].Visible = false;

Amit GuptaPosted Nov 1, 2016, 12:48 PM
switch (gridview.columns[x].HeaderText.ToLower ())
{
case "firstname":
case "lastname":
gridview.Columns [x].Visible =false;
}
}
Bikesh SrivastavaPosted Nov 1, 2016, 8:25 AM
Prakash KumarPosted Nov 1, 2016, 7:07 AM