欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Dev修改gridview 背景色

程序员文章站 2024-02-01 13:39:22
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { //偶数行奇数列||奇数行偶数列 if ( e.RowHandle != grid ......

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 背景色