Problem with setting background color alternating item in datalist to a certain color

F

fig000

Hi,

I have a datalist and I'm using the following code in the
itemdatabound event to change the color to red on alternating items:

If e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.BackColor = System.Drawing.Color.Red
End If

I've used this before and it's worked but I must be doing
something odd this time. What I see when the page is rendered is a
little red line below the first item in my itemtemplate which happens
to be an asp image control. All of the elements of the line appear but
there is no red except for this one little line. In addition, rather
than it appearing on the alternating item (2,4,6, etc) it appears on
the odd numbered items (1,3, etc).

Any help would be appreciated.

Neil
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top