5
Answers

hide several gridview colums at once

Ask a question
Cassie Mod

Cassie Mod

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

Answers (5)