Changing color of a column in a datagrid.

Discussion in 'ASP .Net Datagrid Control' started by UJ, Jan 26, 2007.

  1. UJ

    UJ Guest

    How can you change the background color for a single column in a datagrid. I
    can figure out how to do it for the entire row (e.item.backcolor = ....) but
    how do I do it for a single column?

    TIA - Jeff.
    UJ, Jan 26, 2007
    #1
    1. Advertising

  2. I would use the property builder of the data grid
    <HeaderStyle BackColor="Green"></HeaderStyle>
    <ItemStyle BackColor="Green"></ItemStyle>
    <FooterStyle BackColor="Green"></FooterStyle>




    "UJ" <> wrote in message
    news:...
    > How can you change the background color for a single column in a datagrid.
    > I can figure out how to do it for the entire row (e.item.backcolor = ....)
    > but how do I do it for a single column?
    >
    > TIA - Jeff.
    >
    >
    Alexey Smirnov, Jan 26, 2007
    #2
    1. Advertising

  3. e.Item.Cells.BackColor = ... for every item.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin


    "UJ" <> wrote in message
    news:...
    > How can you change the background color for a single column in a datagrid.

    I
    > can figure out how to do it for the entire row (e.item.backcolor = ....)

    but
    > how do I do it for a single column?
    >
    > TIA - Jeff.
    >
    >
    Eliyahu Goldin, Jan 27, 2007
    #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. =?Utf-8?B?TmVpbA==?=

    DataGrid, changing background color of a Row?

    =?Utf-8?B?TmVpbA==?=, Oct 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    642
    =?Utf-8?B?TmVpbA==?=
    Oct 7, 2004
  2. Robbo
    Replies:
    1
    Views:
    4,186
    Rick Strahl [MVP]
    Oct 18, 2003
  3. Franck
    Replies:
    7
    Views:
    3,416
    Franck
    Oct 12, 2005
  4. Sonny Sablan

    dynamically changing row color in a datagrid

    Sonny Sablan, Apr 2, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    10,331
    Sonny Sablan
    Apr 3, 2006
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    377
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page