Gridview中状态列的值是1,某列的背景是是绿色
状态字段是:archivesStatus
protected void gvInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i <= gvInfo.Rows.Count ; i++)
{
string bqred = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "archivesStatus"));
if (bqred == "1")
{
e.Row.Cells[14].BackColor = System.Drawing.Color.Green;
}
}
}
}
时间: 2024-11-02 11:58:45