等价代码设置:(注意这里使用都是FieldName, 即绑定对象的字段名)
var cn = new StyleFormatCondition(FormatConditionEnum.Expression);
cn.Expression = "[ProduceName] !=null";
cn.Column = gridView4.Columns["Process"];
cn.ApplyToRow = true;
cn.Appearance.BackColor = Color.Green;
//cn.Appearance.Font = new Font(AppearanceObject.DefaultFont, FontStyle.Strikeout);
//cn.Appearance.ForeColor = SystemColors.ActiveCaptionText;
gridView4.FormatConditions.Add(cn);
时间: 2024-10-12 16:22:48