包含特定值的行改变样式

for(int i=0;i<GridView1.Rows.Count;i++)
        {
            string lbl=Convert.ToString(DataBinder.Eval(e.Row.DataItem,"id"));
            if(lbl=="2")
            {
                e.Row.BackColor=System.Drawing.Color.LimeGreen;
            }

           
        }

你可能感兴趣的:(样式)