How do I change the BackColor of a Repeater?

J

jm

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.
 
C

Curt_C [MVP]

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

DalePres

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
 
J

jm

DalePres said:
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

I put it is a label and changed the forecolor. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top