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

  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. 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. Michelle Stone
    Replies:
    0
    Views:
    419
    Michelle Stone
    Oct 15, 2003
  2. beccak
    Replies:
    4
    Views:
    4,975
    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:
    509
  4. BobRoyAce
    Replies:
    2
    Views:
    4,531
    BobRoyAce
    Jan 20, 2005
  5. Ste
    Replies:
    41
    Views:
    815
    Thomas 'PointedEars' Lahn
    Aug 1, 2007
Loading...

Share This Page