zoukankan      html  css  js  c++  java
  • 实现GridControl行动态改变行字体和背景色

     需求:开发时遇到一个问题, 需要根据GridControl行数据不同,实现不同的效果

      在gridView的RowCellStyle的事件中实现,需要的效果

            private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
            {
                string accountQuantity = gridView1.GetRowCellValue(e.RowHandle, "ACCOUNT_QUANTITY").ToString();
                string actualQuantity = gridView1.GetRowCellValue(e.RowHandle, "ACTUAL_QUANTITY").ToString();
                if (accountQuantity != actualQuantity)
                {
                    // e.Appearance.BackColor = Color.Red;//改变背景色
                    e.Appearance.ForeColor = Color.Red;//改变字体颜色
                }
            }

  • 相关阅读:
    jQuery Validate 插件
    本地存储 web storage
    ajax简介及JS写原生ajax
    swiper插件简介及用法
    JavaScript中的string对象及方法
    javascript数组中的方法
    面向对象
    logging模块具体补充
    模块补充
    内置函数总结
  • 原文地址:https://www.cnblogs.com/zhangjd/p/5161613.html
Copyright © 2011-2022 走看看