How to hide a column in datagrid?

Discussion in 'ASP .Net' started by ashtek@gmail.com, Apr 27, 2006.

  1. Guest

    Hi,

    I am using a datagrid with databound columns. I want to set the width
    of one of the columns to zero.
    I use the following code in the design time.

    <ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
    ITEMSTYLE-WIDTH="0">
    </ASP:BOUNDCOLUMN>

    But the column still appears when the page loads showing me the data.

    I do not want to use VISIBLE="False" because I want this column to be
    generated in the client side so that I can access it using JavaScript.

    Anyone has any clue?

    Thanks in advance,
    Ashish.
     
    , Apr 27, 2006
    #1
    1. Advertising

  2. Guest

    This one works!!!!
    Thank you Eliyahu :)
    I am still wondering why does the code HEADERSTYLE-WIDTH="0"
    ITEMSTYLE-WIDTH="0" does not work?
    Thank you,
    Ashish.
     
    , Apr 27, 2006
    #2
    1. Advertising

  3. Ashish,

    Use a css rule display:none.

    Eliyahu

    <> wrote in message
    news:...
    > Hi,
    >
    > I am using a datagrid with databound columns. I want to set the width
    > of one of the columns to zero.
    > I use the following code in the design time.
    >
    > <ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
    > ITEMSTYLE-WIDTH="0">
    > </ASP:BOUNDCOLUMN>
    >
    > But the column still appears when the page loads showing me the data.
    >
    > I do not want to use VISIBLE="False" because I want this column to be
    > generated in the client side so that I can access it using JavaScript.
    >
    > Anyone has any clue?
    >
    > Thanks in advance,
    > Ashish.
    >
     
    Eliyahu Goldin, Apr 27, 2006
    #3
  4. Ashish,

    Browsers have their own logic of setting column width. Your instructions are
    actually only recommendations.

    Eliyahu

    <> wrote in message
    news:...
    > This one works!!!!
    > Thank you Eliyahu :)
    > I am still wondering why does the code HEADERSTYLE-WIDTH="0"
    > ITEMSTYLE-WIDTH="0" does not work?
    > Thank you,
    > Ashish.
    >
     
    Eliyahu Goldin, Apr 27, 2006
    #4
  5. hi
    You dont have to set the column width to 0. Just uncheck the Visible
    checkBox for the Column in the Columns Option of the Property Builder

    Thanks
    Sekhar


    "" wrote:

    > Hi,
    >
    > I am using a datagrid with databound columns. I want to set the width
    > of one of the columns to zero.
    > I use the following code in the design time.
    >
    > <ASP:BOUNDCOLUMN DATAFIELD="FieldName" HEADERSTYLE-WIDTH="0"
    > ITEMSTYLE-WIDTH="0">
    > </ASP:BOUNDCOLUMN>
    >
    > But the column still appears when the page loads showing me the data.
    >
    > I do not want to use VISIBLE="False" because I want this column to be
    > generated in the client side so that I can access it using JavaScript.
    >
    > Anyone has any clue?
    >
    > Thanks in advance,
    > Ashish.
    >
    >
     
    =?Utf-8?B?U2VraGFy?=, Apr 27, 2006
    #5
    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. jonnylbluejeans
    Replies:
    4
    Views:
    5,884
    Rick Spiewak
    Jul 24, 2003
  2. Thanh Nu
    Replies:
    2
    Views:
    972
    Thanh-Nu
    Oct 30, 2003
  3. enak

    Can't hide column in datagrid

    enak, Oct 31, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,994
    Sunil TG
    Oct 31, 2003
  4. Raterus
    Replies:
    1
    Views:
    1,550
    =?Utf-8?B?UmV6YSBOYWJp?=
    Feb 20, 2004
  5. Keithb
    Replies:
    2
    Views:
    1,153
Loading...

Share This Page