ASP.net(C#) GridView符合条件的单元格 背景红白色交替闪烁的问题?
大家好,问一下,我用ASP.net(C#)写一程序,在 GridView中需要将符合条件的单元格 处理成背景红白色交替闪烁.
我的代码如下:
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
string xmcode = this.GridView1.Rows.Cells[0].Text;
if (xmcode.Substring(0, 1) == "*")
{
this.GridView1.Rows.Cells[0].BackColor = Color.Red;
this.GridView1.Rows.Cells[0].ForeColor = Color.White;
}
}
}
以上代码只能将字体变成红色,但我想将该单元格的背景变为红白色交替闪烁.
|