HI
How can i implement a AlternatingItem Style in a asp:table like in a
DataGrid?
ch Beffmans
Jacek Stawicki - 20 Jul 2005 08:06 GMT
for (int i = 0; i < table.Rows.Count; i++ )
if (i % 2 == 0)
table.Rows[i].Attributes.Add("style", "background:red");

Signature
C# Dev
> HI
>
[quoted text clipped - 4 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Siva M - 20 Jul 2005 08:11 GMT
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[i].BackColor = System.Drawing.Color.Orange;
}
HTH
> HI
>
[quoted text clipped - 4 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***