例:
private void gridView3_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
{
if (e.Column.FieldName == "数据")
{
GridCellInfo GridCellInfo = e.Cell as GridCellInfo;
if (GridCellInfo.IsDataCell && double.Parse(GridCellInfo.CellValue.ToString()) <= -30)
e.Appearance.BackColor = Color.Yellow;
else if (GridCellInfo.IsDataCell && double.Parse(GridCellInfo.CellValue.ToString()) > -30
&& double.Parse(GridCellInfo.CellValue.ToString()) <= -50)
e.Appearance.BackColor = Color.Green;
else if (GridCellInfo.IsDataCell && double.Parse(GridCellInfo.CellValue.ToString()) > -50)
e.Appearance.BackColor = Color.Red;
}
}
肯定要存到数据库里面了,这个应该是winform的 我不清楚,但是web的是使用LoadClientLayout这个方法的