DevExpress控件GridControl中单元格颜色问题?

gc_xyz 2011-03-10 07:51:50
如何根据不同的值来设定单元格的颜色???
...全文
731 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jeje 2011-03-10
  • 打赏
  • 举报
回复
LZ Devexpress裏面的控件用的多不,
gc_xyz 2011-03-10
  • 打赏
  • 举报
回复
===自己结贴
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
if (e.Column.FieldName == "cgrbh")
{
string aa = gridView1.GetRowCellDisplayText(e.RowHandle, gridView1.Columns["cgrbh"]);
if (aa == "6666")
{
e.Appearance.BackColor = Color.DeepSkyBlue;
e.Appearance.BackColor2 = Color.LightCyan;
}
}
_三皮_ 2011-03-10
  • 打赏
  • 举报
回复
StyleFormatCondition cn;
cn = new StyleFormatCondition(FormatConditionEnum.Equal, gridView2.Columns["ID"], null, 464);
cn.Appearance.ForeColor = Color.Red;
cn.ApplyToRow = true;
gridView2.FormatConditions.Add(cn);
gc_xyz 2011-03-10
  • 打赏
  • 举报
回复
自己顶,求解//.....

8,834

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 组件/控件开发
社区管理员
  • 组件/控件开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧