[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IStyleCollection.Item

this Property

this[string]

Gets the IStyle object with the specified name from this collection.

Use this property to retrieve a workbook style by its name from the current IStyleCollection.

Declaration
IStyle this[string name] { get; }
ReadOnly Default Property Item(name As String) As IStyle
Parameters
Type Name Description
string name

Specifies the name of an element in the collection.

Examples
IStyleCollection styles = workbook.Styles;
styles.Add("DataStyle");
IStyle style = styles["DataStyle"];
worksheet.Range["A1"].Style = style;

this[int]

Gets the IStyle object at the specified index from this collection.

Use this property to retrieve a built-in or custom named style from the workbook style collection by index.

Declaration
IStyle this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IStyle
Parameters
Type Name Description
int index

Specifies the index of an element in the collection. Valid values are from 0 to Count - 1.

Property Value
Type Description
IStyle

The IStyle object at the specified index.

Examples
IStyleCollection styles = workbook.Styles;
IStyle style = styles[0];
worksheet.Range["A1"].Style = style;