62,041
社区成员
发帖
与我相关
我的任务
分享
//相关Row数据处理
protected void GVDesignList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
}
Button btnDel = (Button)e.Row.FindControl("GVBtnDel");
if (btnDel != null)
{
btnDel.Attributes.Add("onclick", "return confirm('你确定要删除所选择的数据行吗?');");
}
//删除按钮
if (((Label)e.Row.Cells[60].FindControl("lblAdidName")).Text.Trim() == UserName)
{
((Button)e.Row.Cells[1].FindControl("GVBtnDel")).Enabled = true;
}
else
{
((Button)e.Row.Cells[1].FindControl("GVBtnDel")).Enabled = false;
}
//颜色
if (((Label)e.Row.Cells[60].FindControl("GVlblactionZK")).Text.Trim() =="已实施")
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.Green;
e.Row.Cells[3].ForeColor = System.Drawing.Color.Green;
e.Row.Cells[4].ForeColor = System.Drawing.Color.Green;
e.Row.Cells[5].ForeColor = System.Drawing.Color.Green;
}
else if (((Label)e.Row.Cells[60].FindControl("GVlblactionZK")).Text.Trim() == "未实施")
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[4].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[5].ForeColor = System.Drawing.Color.Red;
}
else if (((Label)e.Row.Cells[60].FindControl("GVlblactionZK")).Text.Trim() == "需确认项目")
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.BlueViolet;
e.Row.Cells[3].ForeColor = System.Drawing.Color.BlueViolet;
e.Row.Cells[4].ForeColor = System.Drawing.Color.BlueViolet;
e.Row.Cells[5].ForeColor = System.Drawing.Color.BlueViolet;
}
else if (((Label)e.Row.Cells[60].FindControl("GVlblactionZK")).Text.Trim() == "实施正确项目")
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.Blue;
e.Row.Cells[3].ForeColor = System.Drawing.Color.Blue;
e.Row.Cells[4].ForeColor = System.Drawing.Color.Blue;
e.Row.Cells[5].ForeColor = System.Drawing.Color.Blue;
}
//ForeColor backColor
}
}