protected void gvwInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
//判断是否是标题行
if (e.Row.RowType==DataControlRowType.DataRow)
{
if (!string.IsNullOrEmpty(e.Row.Cells[7].Text)&&!string.IsNullOrEmpty(e.Row.Cells[8].Text))
{
string cell7 = e.Row.Cells[7].Text.ToString();
string cell8 = e.Row.Cells[8].Text.ToString();
switch (cell7)
{
case "0":
e.Row.Cells[8].Text = "基本药物";
break;
default:
e.Row.Cells[8].Text = "非基本药物";
break;
}
switch (cell8)
{
case "0":
e.Row.Cells[7].Text = "<font color=black>限价竟价</font>";
break;
case "1":
e.Row.Cells[7].Text = "<font color=red>重点监控</font>";
break;
case "3":
e.Row.Cells[7].Text = "<font color=gray><i>备案采购</i></font>";
break;
}
}
}
转载于:https://www.cnblogs.com/oidbig/archive/2013/05/03/3057179.html