AlternatingItem Style in asp:table

  • Thread starter Thread starter Beffmans
  • Start date Start date
B

Beffmans

HI

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

ch Beffmans
 
for (int i = 0; i < table.Rows.Count; i++ )
if (i % 2 == 0)
table.Rows.Attributes.Add("style", "background:red");
 
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

Back
Top