New to Telerik Document ProcessingStart a free 30-day trial

Represents cell style collection.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.PropertySystem

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class CellStyleCollection : IEnumerable<CellStyle>, IEnumerable

Inheritance: objectCellStyleCollection

Implements: IEnumerableIEnumerable<CellStyle>

Events

Occurs when the collection is changed.

C#
public event EventHandler Changed

Methods

Adds the specified style.

C#
public CellStyle Add(string styleName, CellStyleCategory category = CellStyleCategory.Custom, bool isRemovable = true)
Parameters:styleNamestring

Name of the style.

categoryCellStyleCategory

The category.

isRemovablebool

A value indicating if the style can be removed later.

Returns:

CellStyle

The style.

Determines whether the specified style is contained.

C#
public bool Contains(CellStyle style)
Parameters:styleCellStyle

The style.

Returns:

bool

True if is contained.

Determines whether the style with the specified name is contained.

C#
public bool Contains(string styleName)
Parameters:styleNamestring

Name of the style.

Returns:

bool

True if is contained.

Gets the style by name.

C#
public CellStyle GetByName(string styleName)
Parameters:styleNamestring

Name of the style.

Returns:

CellStyle

The style.

Returns an enumerator that iterates through the collection.

C#
public IEnumerator<CellStyle> GetEnumerator()
Returns:

IEnumerator<CellStyle>

A IEnumerator<T> that can be used to iterate through the collection.

Implements: IEnumerable<CellStyle>.GetEnumerator()

Called when the collection is changed.

C#
protected virtual void OnChanged()

Removes the specified style.

C#
public bool Remove(CellStyle style)
Parameters:styleCellStyle

The style.

Returns:

bool

True if succeed.

Removes the specified style by name.

C#
public bool Remove(string styleName)
Parameters:styleNamestring

Name of the style.

Returns:

bool

True if succeed.

Properties

Gets the count of the styles.

C#
public int Count { get; }
Property Value:

The count of the styles.

Gets the CellStyle with the specified style name.

C#
public CellStyle this[string styleName] { get; }
Parameters:styleNamestring

The name of the desired style.

Property Value:

The style.

Gets the workbook.

C#
public Workbook Workbook { get; }
Property Value:

The workbook.