Hiding a column

Discussion in 'ASP .Net Datagrid Control' started by Eliyahu Goldin, Apr 7, 2005.

  1. Uri,

    This is the way:

    <asp:BoundColumn DataField="myField">
    <ItemStyle CssClass="Invisible"></ItemStyle><HeaderStyle
    CssClass="Invisible"></HeaderStyle>
    </asp:BoundColumn>

    The style:
    ..Invisible

    {

    display:none;

    }


    Eliyahu

    "Uri" <> wrote in message
    news:42552f1b$...
    > Hi,
    >
    > I'd like to have a bound column contain a hidden field. When I set a
    > column's Visible to false, the column
    > is not rendered at all and I cannot access it programmatically after post
    > back.
    >
    > I've tried leaving the column visible and setting its width to 0px but the
    > column still shows on the page.
    >
    > The best solution I've found is to stick a testbox into one of my existing
    > columns and set its width to 0px.
    >
    > Does anyone know of a more elegant way to do this?
    >
    > Thanks,
    > urig.
    >
    >
     
    Eliyahu Goldin, Apr 7, 2005
    #1
    1. Advertisements

  2. Eliyahu Goldin

    Uri Guest

    Hi,

    I'd like to have a bound column contain a hidden field. When I set a
    column's Visible to false, the column
    is not rendered at all and I cannot access it programmatically after post
    back.

    I've tried leaving the column visible and setting its width to 0px but the
    column still shows on the page.

    The best solution I've found is to stick a testbox into one of my existing
    columns and set its width to 0px.

    Does anyone know of a more elegant way to do this?

    Thanks,
    urig.
     
    Uri, Apr 7, 2005
    #2
    1. Advertisements

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. Michelle Stone
    Replies:
    0
    Views:
    507
    Michelle Stone
    Oct 15, 2003
  2. beccak
    Replies:
    4
    Views:
    5,261
    beccak
    Jun 9, 2004
  3. David Freeman

    DataGrid - Hiding a Column - Not Working

    David Freeman, Oct 22, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    617
  4. BobRoyAce
    Replies:
    2
    Views:
    4,777
    BobRoyAce
    Jan 20, 2005
  5. Paul Ertz
    Replies:
    1
    Views:
    394
    bruno at modulix
    Feb 27, 2006
  6. jack

    Hiding DataGrid column

    jack, May 11, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    447
    Mark Rae
    May 11, 2007
  7. news.microsoft.com

    hiding columns in gird based on column values

    news.microsoft.com, Oct 25, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    423
    Mark Rae [MVP]
    Oct 25, 2007
  8. Ste
    Replies:
    41
    Views:
    1,231
    Thomas 'PointedEars' Lahn
    Aug 1, 2007
Loading...