ConditionalFormattingIconCollection Class
Represents a collection of ConditionalFormattingIcon objects.
Inheritance Hierarchy
SystemObject
  System.CollectionsCollectionBase
    Aspose.CellsConditionalFormattingIconCollection

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
public class ConditionalFormattingIconCollection : CollectionBase

The ConditionalFormattingIconCollection type exposes the following members.

Properties
  NameDescription
Public propertyCapacity
Gets or sets the number of elements that the CollectionBase can contain.
(Inherited from CollectionBase.)
Public propertyCount
Gets the number of elements contained in the CollectionBase instance. This property cannot be overridden.
(Inherited from CollectionBase.)
Protected propertyInnerList
Gets an ArrayList containing the list of elements in the CollectionBase instance.
(Inherited from CollectionBase.)
Public propertyItem
Gets the ConditionalFormattingIcon element at the specified index.
Protected propertyList
Gets an IList containing the list of elements in the CollectionBase instance.
(Inherited from CollectionBase.)
Methods
  NameDescription
Public methodAdd(ConditionalFormattingIcon)
Public methodAdd(IconSetType, Int32)
Public methodClear
Removes all objects from the CollectionBase instance. This method cannot be overridden.
(Inherited from CollectionBase.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the CollectionBase instance.
(Inherited from CollectionBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnClear
Performs additional custom processes when clearing the contents of the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnClearComplete
Performs additional custom processes after clearing the contents of the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnInsert
Performs additional custom processes before inserting a new element into the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnInsertComplete
Performs additional custom processes after inserting a new element into the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnRemove
Performs additional custom processes when removing an element from the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnRemoveComplete
Performs additional custom processes after removing an element from the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnSet
Performs additional custom processes before setting a value in the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnSetComplete
Performs additional custom processes after setting a value in the CollectionBase instance.
(Inherited from CollectionBase.)
Protected methodOnValidate
Performs additional custom processes when validating a value.
(Inherited from CollectionBase.)
Public methodRemoveAt
Removes the element at the specified index of the CollectionBase instance. This method is not overridable.
(Inherited from CollectionBase.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
[C#]

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

Worksheet sheet = workbook.Worksheets[0];

//Get Conditional Formattings
ConditionalFormattingCollection cformattings = sheet.ConditionalFormattings;

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

//Get newly added Conditional formatting
FormatConditionCollection fcs = cformattings[index];

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

ca.StartRow = 0;

ca.EndRow = 0;

ca.StartColumn = 0;

ca.EndColumn = 0;

fcs.AddArea(ca);

ca = new CellArea();

ca.StartRow = 1;

ca.EndRow = 1;

ca.StartColumn = 1;

ca.EndColumn = 1;

fcs.AddArea(ca);

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

 FormatCondition cond = fcs[idx];

 //Sets condition's type
 cond.IconSet.Type = IconSetType.ArrowsGray3;

//Add custom iconset condition.
 ConditionalFormattingIcon cfIcon = cond.IconSet.CfIcons[0];

 cfIcon.Type = IconSetType.Arrows3;

 cfIcon.Index = 0;

 ConditionalFormattingIcon cfIcon1 = cond.IconSet.CfIcons[1];

  cfIcon1.Type = IconSetType.ArrowsGray3;

  cfIcon1.Index = 1;

  ConditionalFormattingIcon cfIcon2 = cond.IconSet.CfIcons[2];

  cfIcon2.Type = IconSetType.Boxes5;

  cfIcon2.Index = 2;

//Saving the Excel file
workbook.Save("C:\\output.xls");

[VB.NET]

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

Dim sheet As Worksheet = workbook.Worksheets(0)

'Get Conditional Formattings
Dim cformattings As ConditionalFormattingCollection = sheet.ConditionalFormattings

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

'Get newly added Conditional formatting
Dim fcs As FormatConditionCollection = cformattings(index)

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

ca.StartRow = 0

ca.EndRow = 0

ca.StartColumn = 0

ca.EndColumn = 0

fcs.AddArea(ca)

ca = New CellArea()

ca.StartRow = 1

ca.EndRow = 1

ca.StartColumn = 1

ca.EndColumn = 1

fcs.AddArea(ca)

//Sets condition
Dim idx As Integer =fcs.AddCondition(FormatConditionType.IconSet)

Dim cond As FormatCondition=fcs[idx]

//Sets condition's type
cfIcon.Type = IconSetType.ArrowsGray3

'Add custom iconset  condition.
Dim cfIcon As ConditionalFormattingIcon = cond.IconSet.CfIcons[0]

cfIcon.Type = IconSetType.Arrows3

cfIcon.Index=0

Dim cfIcon1 As ConditionalFormattingIcon = cond.IconSet.CfIcons[1]

cfIcon1.Type = IconSetType.ArrowsGray3

cfIcon1.Index=1

Dim cfIcon2 As ConditionalFormattingIcon = cond.IconSet.CfIcons[2]

cfIcon2.Type = IconSetType.Boxes5

cfIcon2.Index=2

'Saving the Excel file
workbook.Save("C:\output.xls")
See Also