zoukankan      html  css  js  c++  java
  • Gridview中修改某列的背景色

    Gridview中状态列的值是1,某列的背景是是绿色
    状态字段是:archivesStatus
     protected void gvInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {            
                for (int i = 0; i <= gvInfo.Rows.Count ; i++)
                {                
                    string bqred = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "archivesStatus"));
                    if (bqred == "1")
                    {
                        e.Row.Cells[14].BackColor = System.Drawing.Color.Green;
                    }                
                }
            }
        }

  • 相关阅读:
    链表实现
    @Aspect
    mybatis plus
    using
    50道题
    梦想,青春,时间
    存储过程!!!
    事务,视图,索引
    高级查询--嵌套和相关,两套分页!!!
    学习笔记
  • 原文地址:https://www.cnblogs.com/ahao214/p/4026432.html
Copyright © 2011-2022 走看看