Hide columns in GridView

  • Thread starter Thread starter DavidC
  • Start date Start date
D

DavidC

I want to be able to sometimes hide columns in a GridView based on conditions
(certain client types) but I'm not sure how to do it. We are using asp.net
3.5 and VS2008.

Thanks.
 
DavidC said:
I want to be able to sometimes hide columns in a GridView based on
conditions
(certain client types) but I'm not sure how to do it. We are using
asp.net
3.5 and VS2008.

Thanks.

Read this:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.columns.aspx

Note especially this comment:

"Although you can programmatically add column fields to the Columns
collection, it is easier to list the column fields declaratively in the
GridView control and then use the Visible property of each column field to
show or hide each column field."
 
Back
Top