问候专家。如果'状态'字段为空,我有一个GridView,它是我需要关注的行。下面的代码会引发异常。我得到一个“不可调用的成员”System.Web.UI.WebControls.GridViewRow.DataItem'不能像方法一样使用“。我认为我非常接近,但我不知道下一步该转向哪里。C#,ASP.NET:根据内容格式化GRIDVIEW行
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow &&
e.Row.DataItem("Status") == null)
{
// e.Row.BackColor = Drawing.Color.Red;
}
}