Skip to main content
A newer version of this page is available. .

How to: Temporarily Highlight Cells When Their Values Change

This example uses a FormatConditionRuleDataUpdate format to temporarily highlight cells when their values increase. The highlight effect includes a custom background color and icon.

XtraGrid.GridFormatRule gridFormatRule = new DevExpress.XtraGrid.GridFormatRule();
DevExpress.XtraEditors.FormatConditionRuleDataUpdate formatConditionRuleDataUpdate = new DevExpress.XtraEditors.FormatConditionRuleDataUpdate();
gridFormatRule.Column = gridView1.Columns["Change"];
gridFormatRule.Name = "Format1";
formatConditionRuleDataUpdate.HighlightTime = 500;
formatConditionRuleDataUpdate.Icon.PredefinedName = "Flags3_1.png";
formatConditionRuleDataUpdate.PredefinedName = "Green Fill";
formatConditionRuleDataUpdate.Trigger = FormatConditionDataUpdateTrigger.ValueIncreased;
gridFormatRule.Rule = formatConditionRuleDataUpdate;
gridView1.FormatRules.Add(gridFormatRule);