vcl-dxspreadsheetconditionalformattingrules-dot-tdxspreadsheetconditionalformattingruleiconset.md
Specifies the identifier name of the icon preset that corresponds to the rule’s threshold points.
property PresetName: string read; write;
| Type | Description |
|---|---|
| string |
The name of the active icon preset.
You can call the global ConditionalFormattingIconSet function to access the icon preset collection.
|
The Icon Set conditional formatting rule ships with 19 icon presets available for selection. Refer to the TdxSpreadSheetConditionalFormattingIconSet.Presets property description for the full list of available icon sets.
Use the PresetName property to switch between available icon presets for the Icon Set conditional formatting rule.
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;
TdxSpreadSheetConditionalFormattingRuleIconSet *ARule;
// ...
cxGrid1DBTableView1->ConditionalFormatting->Add(0,
__classid(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
}
The PresetName property’s default value is an empty string.
The default PresetName property value indicates that the 3 Arrows preset is active. The Icon Set rule also uses this icon preset if you assign a name that does not match one of the preset names in the global icon preset collection.
See Also
TdxSpreadSheetConditionalFormattingRuleIconSet.Order Property
TdxSpreadSheetConditionalFormattingRuleIconSet.StopCount Property
TdxSpreadSheetConditionalFormattingRuleIconSet Class