hide a column programatically

Discussion in 'ASP .Net Datagrid Control' started by Bruno Alexandre, Apr 25, 2006.

  1. Hi guys,

    How can I HIDE a GridView Column programatically?

    I have a column that has the prices, but I only want the user view the
    prices if they enter the correct password, at this time I have 2 gridviews I
    use the visible property to change between them...

    but can I do this having just one gridview and hide the column like
    GridView1.ColumnHeaderName.visible = False ?

    --


    Thank you in Advance.

    Bruno Alexandre
    (a Portuguese in Denmark)
     
    Bruno Alexandre, Apr 25, 2006
    #1
    1. Advertising

  2. Bruno Alexandre

    Manikandan Guest

    Hi Bruno !



    Hope this code will help you resolve the issue you access the specific
    column and set it visible property to false ,
    like this

    DataGridView.Columns["ColumnName"].Visible = false;





    "Bruno Alexandre" <> wrote in message
    news:...
    > Hi guys,
    >
    > How can I HIDE a GridView Column programatically?
    >
    > I have a column that has the prices, but I only want the user view the
    > prices if they enter the correct password, at this time I have 2 gridviews
    > I use the visible property to change between them...
    >
    > but can I do this having just one gridview and hide the column like
    > GridView1.ColumnHeaderName.visible = False ?
    >
    > --
    >
    >
    > Thank you in Advance.
    >
    > Bruno Alexandre
    > (a Portuguese in Denmark)
    >
    >
     
    Manikandan, May 2, 2006
    #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. Dan Hartshorn

    Programatically Change Datagrid column type?

    Dan Hartshorn, Apr 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,045
    Dan Hartshorn
    Apr 13, 2004
  2. Keithb
    Replies:
    2
    Views:
    1,160
  3. Kbalz
    Replies:
    2
    Views:
    1,349
    Kbalz
    Oct 4, 2007
  4. EdwardH
    Replies:
    0
    Views:
    514
    EdwardH
    Oct 12, 2008
  5. Audun Simonsen

    Programatically add column

    Audun Simonsen, Feb 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    135
    Audun Simonsen
    Feb 3, 2004
Loading...

Share This Page