IconSet class

Describe the IconSet conditional formatting rule. This conditional formatting rule applies icons to cells according to their values.

public class IconSet


Name Description
CfIcons { get; } Get theConditionalFormattingIcon from the collection
Cfvos { get; } Get the CFValueObjects instance.
IsCustom { get; } Indicates whether the icon set is custom. Default value is false.
Reverse { get; set; } Get or set the flag indicating whether to reverses the default order of the icons in this icon set. Default value is false.
ShowValue { get; set; } Get or set the flag indicating whether to show the values of the cells on which this icon set is applied. Default value is true.
Type { get; set; } Get or Set the icon set type to display. Setting the type will auto check if the current Cfvos’s count is accord with the new type. If not accord, old Cfvos will be cleaned and default Cfvos will be added.



//Instantiating a Workbook object
Workbook workbook = new Workbook();

Worksheet sheet = workbook.Worksheets[0];

//Adds an empty conditional formatting
int index = sheet.ConditionalFormattings.Add();

FormatConditionCollection fcs = sheet.ConditionalFormattings[index];

//Sets the conditional format range.
CellArea ca = new CellArea();

ca.StartRow = 0;

ca.EndRow = 2;

ca.StartColumn = 0;

ca.EndColumn = 0;


//Adds condition.
int idx = fcs.AddCondition(FormatConditionType.IconSet);


FormatCondition cond = fcs[idx];

//Get Icon Set
IconSet iconSet = cond.IconSet;

//Set Icon Type
iconSet.Type = IconSetType.Arrows3;

//Put Cell Values
Aspose.Cells.Cell cell1 = sheet.Cells["A1"];


Aspose.Cells.Cell cell2 = sheet.Cells["A2"];


Aspose.Cells.Cell cell3 = sheet.Cells["A3"];


//Saving the Excel file


'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()

Dim sheet As Worksheet = workbook.Worksheets(0)

'Adds an empty conditional formatting
Dim index As Integer = sheet.ConditionalFormattings.Add()

Dim fcs As FormatConditionCollection = sheet.ConditionalFormattings(index)

'Sets the conditional format range.
Dim ca As New CellArea()

ca.StartRow = 0

ca.EndRow = 2

ca.StartColumn = 0

ca.EndColumn = 0


'Adds condition.
Dim idx As Integer = fcs.AddCondition(FormatConditionType.IconSet)


Dim cond As FormatCondition = fcs(idx)

'Get Icon Set
Dim iconSet As IconSet = cond.IconSet

'Set Icon Type
iconSet.Type = IconSetType.Arrows3

'Put Cell Values
Dim cell1 As Aspose.Cells.Cell = sheet.Cells("A1")


Dim cell2 As Aspose.Cells.Cell = sheet.Cells("A2")


Dim cell3 As Aspose.Cells.Cell = sheet.Cells("A3")


'Saving the Excel file

See Also