protected void gvwInfo_RowDataBound(object sender, GridViewRowEventArgs e)

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;
                }
            }
        }

posted @ 2013-05-03 18:22  落花〆、春雨鸣  阅读(228)  评论(0编辑  收藏  举报