Click or drag to resize

CellStyle Properties

The CellStyle type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleBorders

Gets or sets the borders.

If set to , borders will be resolved from referenced workbook style.

Public propertyCode exampleFillPattern

Gets or sets the fill (cell background).

If set to , fill will be resolved from referenced workbook style.

Fill can be either pattern or gradient.

Gradient fill is currently supported in XLSX and partially in rendering formats (PDF, XPS and image formats).

Public propertyCode exampleFont

Gets or sets the font.

If set to , font will be resolved from referenced workbook style.

Public propertyCode exampleFormulaHidden

Gets or sets a value indicating whether the contents of the cell will not be displayed in the formula bar.

Default value is .

Public propertyCode exampleHorizontalAlignment

Gets or sets the horizontal alignment.

Default value is General.

Public propertyCode exampleIndent

Gets or sets the number of spaces (of the Normal style font) of indentation for text in a cell.

The number of spaces to indent is calculated as following: Number of spaces to indent = Indent * 3.

Default value is 0.

Public propertyCode exampleIsDefault
Gets a value indicating whether the referenced workbook style is default (Normal) and there are no additional modifications of cell formatting.
Public propertyCode exampleIsTextVertical

Gets or sets a value indicating whether text orientation is vertical.

Default value is .

Public propertyCode exampleLocked

Gets or sets a value indicating whether the cell is locked.

Default value is .

Public propertyCode exampleName

If CellStyle is workbook Style, gets or sets the name of the style; otherwise, gets the name of the referenced workbook Style from which this CellStyle inherits formatting.

Default value is Normal.

Public propertyCode exampleNumberFormat

Gets or sets the number format which indicates how to format and render the numeric value of a cell.

Default value is General.

If set to , number format will be resolved from referenced workbook style.

Public propertyNumberFormatLocal
Gets a String that represents the format code for the numeric value in the language of the user.
Public propertyCode exampleQuotePrefix

Gets or sets a value indicating whether the text string in a cell should be prefixed by a single quote mark (e.g., 'text). Use it to store numeric value of a cell as text.

Default value is .

Public propertyCode exampleRotation

Gets or sets the text rotation in degrees (1/360th of a full circle).

Value must be between -90 and 90 and specifies counterclockwise rotation of the text from the normal position. The first letter of the text is considered the center-point of the arc.

Default value is 0.

This member is currently not supported in PDF, XPS and image file formats.

Public propertyCode exampleShrinkToFit

Gets or sets a value indicating whether the displayed text in the cell should be shrunk to fit the cell width. Not applicable when a cell contains multiple lines of text.

Default value is .

Public propertyCode exampleVerticalAlignment

Gets or sets the vertical alignment.

Default value is Bottom.

Public propertyCode exampleWrapText

Gets or sets a value indicating whether the text in a cell should be line-wrapped within the cell.

Default value is .

Top
See Also