首页 > Web开发 > 详细

aspxGridview 根据单元格值得不同,设置单元格字体的颜色(设置和读取值)

时间:2020-01-09 21:08:45      阅读:102      评论:0      收藏:0      [点我收藏+]
protected void ASPxGridView1_HtmlRowCreated(object sender,DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return;

            string errorPercent = e.GetValue("ErrorPercent").ToString();
            errorPercent = errorPercent.Substring(0, errorPercent.Length - 1);
            float errorPercentInt = float.Parse(errorPercent);
            if (errorPercentInt >= 3 || errorPercentInt<=-3)
            {
                e.Row.Cells[11].Style.Add("color", "Red");
            }
        }

aspxGridview 根据单元格值得不同,设置单元格字体的颜色(设置和读取值)

原文:https://www.cnblogs.com/ljs-13/p/12173208.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!