How do I change the BackColor of a Repeater?

Discussion in 'ASP .Net' started by jm, May 12, 2004.

  1. jm

    jm Guest

    I have a repeater and based upon some database results want to change
    the backcolor or font color of the row at my databind statement.

    I have done this before with a datagrid:

    e.Item.BackColor = System.Drawing.Color.Red

    But this is unavailable with the repeater. Do I have to change to a
    DataGrid for this functionality? Thank you.
    jm, May 12, 2004
    #1
    1. Advertising

  2. jm

    Curt_C [MVP] Guest

    repeater spits out html, you'll have to render it to SOME type of control
    that allows coloring of the background

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "jm" <> wrote in message
    news:...
    > I have a repeater and based upon some database results want to change
    > the backcolor or font color of the row at my databind statement.
    >
    > I have done this before with a datagrid:
    >
    > e.Item.BackColor = System.Drawing.Color.Red
    >
    > But this is unavailable with the repeater. Do I have to change to a
    > DataGrid for this functionality? Thank you.
    Curt_C [MVP], May 12, 2004
    #2
    1. Advertising

  3. jm

    DalePres Guest

    I suggest you use a table in your Repeater. Put the opening <TABLE> in the
    headertemplate and close your table in the footertemplate. Set the bgcolor
    of the table to the background you want.

    Dale


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:uI$...
    > repeater spits out html, you'll have to render it to SOME type of control
    > that allows coloring of the background
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "jm" <> wrote in message
    > news:...
    > > I have a repeater and based upon some database results want to change
    > > the backcolor or font color of the row at my databind statement.
    > >
    > > I have done this before with a datagrid:
    > >
    > > e.Item.BackColor = System.Drawing.Color.Red
    > >
    > > But this is unavailable with the repeater. Do I have to change to a
    > > DataGrid for this functionality? Thank you.

    >
    >
    DalePres, May 13, 2004
    #3
  4. jm

    jm Guest

    "DalePres" <> wrote in message news:<>...
    > I suggest you use a table in your Repeater. Put the opening <TABLE> in the
    > headertemplate and close your table in the footertemplate. Set the bgcolor
    > of the table to the background you want.
    >
    > Dale
    >
    >
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:uI$...
    > > repeater spits out html, you'll have to render it to SOME type of control
    > > that allows coloring of the background
    > >
    > > --
    > > Curt Christianson
    > > Owner/Lead Developer, DF-Software
    > > Site: http://www.Darkfalz.com
    > > Blog: http://blog.Darkfalz.com
    > >
    > >
    > > "jm" <> wrote in message
    > > news:...
    > > > I have a repeater and based upon some database results want to change
    > > > the backcolor or font color of the row at my databind statement.
    > > >
    > > > I have done this before with a datagrid:
    > > >
    > > > e.Item.BackColor = System.Drawing.Color.Red
    > > >
    > > > But this is unavailable with the repeater. Do I have to change to a
    > > > DataGrid for this functionality? Thank you.

    > >
    > >


    I put it is a label and changed the forecolor. Thanks.
    jm, May 14, 2004
    #4
    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. Grey
    Replies:
    2
    Views:
    37,604
    =?Utf-8?B?YWRhbUB0d3Yub3Jn?=
    May 17, 2004
  2. Vadim
    Replies:
    1
    Views:
    450
    Eliyahu Goldin
    Feb 24, 2005
  3. Franck
    Replies:
    1
    Views:
    716
    Eliyahu Goldin
    Jun 7, 2005
  4. rjl
    Replies:
    5
    Views:
    633
  5. Carlos Barini

    Howto change an Column Backcolor?

    Carlos Barini, Jul 19, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    Carlos Barini
    Jul 19, 2006
Loading...

Share This Page