SIMPLE ? - Make Column Visible In Gridview

Discussion in 'ASP .Net' started by Phillip Vong, Jun 7, 2006.

  1. Phillip Vong

    Phillip Vong Guest

    Sorry about this simple question.

    I'm running ASP.NET 2.0 using VS2005.

    I have a simple Gridview. I have a column named "WhoUpdate" with visible =
    False.
    <asp:BoundField DataField="WhoUpdate" HeaderText="WhoUpdate"
    SortExpression="WhoUpdate" Visible="False" />


    I have a simple Button outside of the gridview. I just want to make it so
    when someone clicks this button, the WhoUpdate column will be visible =
    True.

    Thanks!

    Phil
     
    Phillip Vong, Jun 7, 2006
    #1
    1. Advertising

  2. Phillip Vong

    PeterKellner Guest

    On Tue, 6 Jun 2006 22:40:30 -0400, "Phillip Vong"
    <phillip_vong*at*yahoo*dot*com> wrote:

    >Sorry about this simple question.
    >
    >I'm running ASP.NET 2.0 using VS2005.
    >
    >I have a simple Gridview. I have a column named "WhoUpdate" with visible =
    >False.
    ><asp:BoundField DataField="WhoUpdate" HeaderText="WhoUpdate"
    >SortExpression="WhoUpdate" Visible="False" />
    >
    >
    >I have a simple Button outside of the gridview. I just want to make it so
    >when someone clicks this button, the WhoUpdate column will be visible =
    >True.
    >
    >Thanks!
    >
    >Phil
    >


    how about this: (the 2 is the third column)

    protected void Button1_Click(object sender, EventArgs e)
    {
    GridView1.Columns[2].Visible = false;
    }
    Peter Kellner
    http://peterkellner.net
     
    PeterKellner, Jun 7, 2006
    #2
    1. Advertising

  3. Phillip Vong

    Phillip Vong Guest

    That's Perfect! Thanks!

    Phil


    "PeterKellner" <> wrote in message
    news:...
    > On Tue, 6 Jun 2006 22:40:30 -0400, "Phillip Vong"
    > <phillip_vong*at*yahoo*dot*com> wrote:
    >
    >>Sorry about this simple question.
    >>
    >>I'm running ASP.NET 2.0 using VS2005.
    >>
    >>I have a simple Gridview. I have a column named "WhoUpdate" with visible
    >>=
    >>False.
    >><asp:BoundField DataField="WhoUpdate" HeaderText="WhoUpdate"
    >>SortExpression="WhoUpdate" Visible="False" />
    >>
    >>
    >>I have a simple Button outside of the gridview. I just want to make it so
    >>when someone clicks this button, the WhoUpdate column will be visible =
    >>True.
    >>
    >>Thanks!
    >>
    >>Phil
    >>

    >
    > how about this: (the 2 is the third column)
    >
    > protected void Button1_Click(object sender, EventArgs e)
    > {
    > GridView1.Columns[2].Visible = false;
    > }
    > Peter Kellner
    > http://peterkellner.net
     
    Phillip Vong, Jun 7, 2006
    #3
    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. spamfurnace
    Replies:
    1
    Views:
    2,667
    Scott M.
    May 24, 2004
  2. Patrick Olurotimi Ige
    Replies:
    7
    Views:
    6,042
    Patrick Olurotimi Ige
    Jun 15, 2005
  3. Keithb
    Replies:
    2
    Views:
    1,199
  4. Keith G Hicks
    Replies:
    3
    Views:
    803
    Keith G Hicks
    Feb 18, 2008
  5. Jurjen de Groot
    Replies:
    0
    Views:
    330
    Jurjen de Groot
    May 19, 2008
Loading...

Share This Page