Hide columns in GridView

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.
 
P

PvdG42

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top