gridView1_CustomDrawCell与gridView1_RowCellStyle都可以且用法一样。但是CustomDrawCell更稳定
private void gridView1_CustomDrawCell(
object sender, RowCellStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender
as DevExpress.XtraGrid.Views.Grid.GridView;
//列名=a,值=1的标记为绿色
if (e.CellValue.ToString() ==
"1" && e.Column.FieldName.ToString().Equals(
"a"))
{
e.Appearance.BackColor = Color.FromArgb(
128,
255,
128);
e.Column.DisplayFormat.FormatString =
"yyyy-MM-dd HH:mm:ss";
}
}
转载于:https://www.cnblogs.com/lhlong/p/4875039.html
相关资源:Dev17.1版本RichEditControl 表格插入与合并,插入图片