Dev修改gridview 背景色

时间:2022-12-10 14:48:45

private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
//偶数行奇数列||奇数行偶数列
if ( e.RowHandle != gridView1.FocusedRowHandle &&
((e.RowHandle % 2 == 0 && e.Column.VisibleIndex % 2 == 1) ||
( e.Column.VisibleIndex % 2 == 0 && e.RowHandle % 2 == 1)) )
e.Appearance.BackColor = Color.AliceBlue;
}

Dev修改gridview 背景色