gridcontrol根据条件设置grid颜色显示

来源:互联网 发布:怎样设计淘宝店铺 编辑:程序博客网 时间:2024/06/05 09:29
Run Designer    Appearance  中的  Style Conditions    Add  一个  Style Condition Item  调整右边的属性
[Appearance] - 
显示的风格
[ApplyToRow] - 
应用到整行
[Column] - 
要检查的列字段(必须包含在  Columns  中,可以是不显示的)
[Condition] - 
运算符(==,!=,<,>,...)
[Tag] - Item
的附加数据(基本没用)
[Value1] - 
单值检查(==,!=,<,>,...)的值,或双值检查(between,..)的第一个值

[Value2] - 双值检查(between,..)的第二个值


也可在代码中加入如下:(delphi2006下)

  StyleFormatCondition11.Appearance.Options.UseBackColor := True;
  StyleFormatCondition11.ApplyToRow := True;
  StyleFormatCondition11.Column := Self.colisover;
  StyleFormatCondition11.Condition := DevExpress.XtraGrid.FormatConditionEnum.Equal;
  StyleFormatCondition11.Value1 := True;
  Self.GridView1.FormatConditions.AddRange(TArrayOfDevExpress_XtraGrid_StyleFormatCondition.Create(StyleFormatCondition11));



原创粉丝点击