devExpress

DEV GridControl ID相同的行显示相同的颜色

时间:2013-10-17 22:31:34  作者:WPF之家  来源:http://www.wpf123.com/  查看:1364  评论:0
内容摘要:基于DEV1.1.2 CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)存在BUG,经过测试研究,使用以下方法private void gridVi...

基于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;
}
}
}


标签:相同 相同的 显示 颜色 

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。本文出自“wpf之家”,请务必保留此出处:http://www.wpf123.com

相关评论
Copyright © 2009-2014 WPF之家(http://www.wpf123.com/) All rights reserved
 Powered by WPF之家
鄂ICP备13006396号