DevExpress的gridcontrol里面,怎么设置指定行的某列的背景色
2个回答
展开全部
例:
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;
}
}
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;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-05-01
展开全部
肯定要存到数据库里面了,这个应该是winform的 我不清楚,但是web的是使用LoadClientLayout这个方法的
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询