RT

解决方案 »

  1.   

    RowDataBound事件中if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.Cells[0].Text == "1")
                {
                    e.Row.BackColor = System.Drawing.Color.Red;
                }
                else
                {
                    e.Row.BackColor = System.Drawing.Color.Blue;
                
                }
            }如果数据空中的值为"null",那么就用    来进行判断(  代表IE中的5个字符或者半角的空格(?))
      

  2.   

    行变色吗?行变色见下面代码。
     /// <summary>
        /// GridViewRow行背景色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GVTransitJob_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0FF';this.style.color='buttontext';this.style.cursor='default';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';this.style.color='';");
            }
        }
      

  3.   

    说清楚点
    是WEB还是WIN可以在RowDataBound事件里面做