Skip to main content

TdxSpreadSheetConditionalFormattingRuleIconSet.Stops Property

Provides indexed access to individual icon set thresholds.

Declaration

property Stops[Index: Integer]: TdxSpreadSheetConditionalFormattingRuleIconSetStop read; write;

Property Value

Type Description
TdxSpreadSheetConditionalFormattingRuleIconSetStop

An Icon Set rule threshold.

The StopCount property specifies the number of accessible threshold points (the minimum is 3).

Remarks

An Icon Set conditional formatting rule marks cell values with icons according to threshold values associated with the icons. You can use the Stops property to access and configure individual threshold points.

Code Example: Apply an Icon Set Conditional Formatting Rule to a Data Grid Column

The following code example creates an Icon Set conditional formatting rule with three threshold values and applies the rule to the first column in a TcxGrid control’s data-aware Table View:

var
  ARule: TdxSpreadSheetConditionalFormattingRuleIconSet;
begin
  cxGrid1DBTableView1.ConditionalFormatting.Add(0, TdxSpreadSheetConditionalFormattingRuleIconSet, ARule);
  ARule.BeginUpdate;  // Initiates the following batch change
  try
    ARule.PresetName := ConditionalFormattingIconSet.Presets.Items[1].Name;
    ARule.Stops[0].ValueType := cssvtValue;
    ARule.Stops[0].Value := 0;
    ARule.Stops[1].ValueType := cssvtValue;
    ARule.Stops[1].Value := 25;
    ARule.Stops[2].ValueType := cssvtValue;
    ARule.Stops[2].Value := 50;
  finally  
    ARule.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;
See Also