标签:and wce LLC use custom null span end lse
1 private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { 2 if (gridView1.GetDataRow(e.RowHandle) == null) 3 return; 4 if (gridView1.GetDataRow(e.RowHandle)["COLOR"].ToString() == "true") { 5 //该行数据的该列的值为true时,背景色为红色 6 e.Appearance.BackColor = Color.Red; 7 } 8 else { 9 e.Appearance.BackColor = Color.White; 10 } 11 if (e.RowHandle == gridView1.FocusedRowHandle) { 12 e.Appearance.ForeColor = Color.White; 13 e.Appearance.BackColor = Color.RoyalBlue; 14 } 15 }
先找到GridView 中的事件 CustomDrawCell 双击写入代码
标签:and wce LLC use custom null span end lse
原文地址:https://www.cnblogs.com/zgrh/p/11112505.html