Hide columns in GridView

Discussion in 'ASP .Net' started by DavidC, Feb 3, 2010.

  1. DavidC

    DavidC Guest

    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.
    --
    David
    DavidC, Feb 3, 2010
    #1
    1. Advertising

  2. DavidC

    PvdG42 Guest

    "DavidC" <> wrote in message
    news:...
    > 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.
    > --
    > David


    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."
    PvdG42, Feb 3, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    3
    Views:
    17,000
    Jan Hyde
    May 8, 2006
  2. =?Utf-8?B?Q1NoYXJwZ3V5?=

    hide columns in export of gridview

    =?Utf-8?B?Q1NoYXJwZ3V5?=, Sep 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    472
    =?Utf-8?B?Q1NoYXJwZ3V5?=
    Sep 7, 2006
  3. Phil Sandler

    Hide Columns in GridView?

    Phil Sandler, Dec 21, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    868
    Eliyahu Goldin
    Dec 22, 2006
  4. =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?=

    Hide a few (variable) columns in a GridView

    =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?=, Feb 13, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    795
    Alexey Smirnov
    Feb 15, 2007
  5. David C

    Hide GridView Columns

    David C, Feb 29, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    543
    David C
    Feb 29, 2008
Loading...

Share This Page