基于DEV1.1.2 CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)存在BUG,经过测试研究,使用以下方法

private void gridViewCarList_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
if (e.RowHandle >= 0)
{
string id = view.GetRowCellDisplayText(e.RowHandle, this.colRowCountID);

if (Convert.ToInt32(id) % 3 == 1)
{
e.CellStyle.BackColor = Color.Bisque;
}

if (Convert.ToInt32(id) % 3 == 2)
{
e.CellStyle.BackColor = Color.CornflowerBlue;
}

if (Convert.ToInt32(id) % 3 == 0)
{
e.CellStyle.BackColor = Color.White;
}
}
}

相关文章:

  • 2021-06-03
  • 2022-02-14
  • 2022-01-13
  • 2022-12-23
猜你喜欢
  • 2021-05-26
  • 2021-10-13
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案