62,050
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[3].Text == "-1")
{
e.Row.Cells[3].Text = "未评";
}
else
{
e.Row.Cells[3].Text = "<font color=red>未考</font>";
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lb= (Label)e.Row.FindControl("labObjScoreNum1");
if (lb.Text.Trim() == "")
{
lb.Text = "未考";
}
else if(lb.Text == "-1")
{
lb.Text = "未评";
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lb= (Label)e.Row.FindControl("labObjScoreNum1");
if (lb.Text == "-1")
{
lb.Text = "未评";
}
else
{
lb.Text = "<font color=red>未考</font>";
}
}
}
this.GridView1.DataBind();
////////////databind后写下下面的东西.GridView1换成你的
for (int i = 0; i < this.GridView1.Rows.Count; i++)
{
GridViewRow gvr = this.GridView1.Rows[i];
if (gvr.RowType == DataControlRowType.DataRow)
{
Label labObjScoreNum1 = (Label)e.Row.FindControl("labObjScoreNum1");
if (labObjScoreNum1.Text.Trim() == "")
{
labObjScoreNum1.Text = "未考";
}
else if (labObjScoreNum1.Text.Trim() == "-1")
{
labObjScoreNum1.Text = "未评";
}
//......
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[3].Text == "-1")
{
e.Row.Cells[3].Text = "未评";
}
else
{
e.Row.Cells[3].Text = "<font color=red>未考</font>";
}
}
}