需求:开发时遇到一个问题, 需要根据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;//改变字体颜色
            }
        }

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-07-26
  • 2021-06-22
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
猜你喜欢
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案