AlternatingItem Style in asp:table

B

Beffmans

HI

How can i implement a AlternatingItem Style in a asp:table like in a
DataGrid?

ch Beffmans
 
G

Guest

for (int i = 0; i < table.Rows.Count; i++ )
if (i % 2 == 0)
table.Rows.Attributes.Add("style", "background:red");
 
G

Guest

Hello,

I don't think there is any direct way to do it but loop thru and the color
manually. Eg:

for (int i=0; i<Table1.Rows.Count; i++)
{
if (i%2 != 0) continue;
Table1.Rows.BackColor = System.Drawing.Color.Orange;
}

HTH
 

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,776
Messages
2,569,603
Members
45,190
Latest member
Martindap

Latest Threads

Top