CellFormat Class

Formatting Elements.When the object is serialized out as xml, its qualified name is x:xf.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Spreadsheet.CellFormat

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(ExtensionList))> _
<ChildElementInfoAttribute(GetType(Protection))> _
<ChildElementInfoAttribute(GetType(Alignment))> _
Public Class CellFormat _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As CellFormat
[ChildElementInfoAttribute(typeof(ExtensionList))]
[ChildElementInfoAttribute(typeof(Protection))]
[ChildElementInfoAttribute(typeof(Alignment))]
public class CellFormat : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • Alignment <x:alignment>

  • Protection <x:protection>

  • ExtensionList <x:extLst>

[ISO/IEC 29500-1 1st Edition]

18.8.45 xf (Format)

A single xf element describes all of the formatting for a cell.

Parent Elements

cellStyleXfs (§18.8.9); cellXfs (§18.8.10)

Child Elements

Subclause

alignment (Alignment)

§18.8.1

extLst (Future Feature Data Storage Area)

§18.2.10

protection (Protection Properties)

§18.8.33

Attributes

Description

applyAlignment (Apply Alignment)

A boolean value indicating whether the alignment formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyBorder (Apply Border)

A boolean value indicating whether the border formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyFill (Apply Fill)

A boolean value indicating whether the fill formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyFont (Apply Font)

A boolean value indicating whether the font formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyNumberFormat (Apply Number Format)

A boolean value indicating whether the number formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyProtection (Apply Protection)

A boolean value indicating whether the protection formatting specified for this xf should be applied.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

borderId (Border Id)

Zero-based index of the border record used by this cell format.

The possible values for this attribute are defined by the ST_BorderId simple type (§18.18.2).

fillId (Fill Id)

Zero-based index of the fill record used by this cell format.

The possible values for this attribute are defined by the ST_FillId simple type (§18.18.30).

fontId (Font Id)

Zero-based index of the font record used by this cell format.

The possible values for this attribute are defined by the ST_FontId simple type (§18.18.32).

numFmtId (Number Format Id)

Id of the number format (numFmt) record used by this cell format.

The possible values for this attribute are defined by the ST_NumFmtId simple type (§18.18.47).

pivotButton (Pivot Button)

A boolean value indicating whether the cell rendering includes a pivot table dropdown button.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

quotePrefix (Quote Prefix)

A boolean value indicating whether the text string in a cell should be prefixed by a single quote mark (e.g., 'text). In these cases, the quote is not stored in the Shared Strings Part.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

xfId (Format Id)

For xf records contained in cellXfs this is the zero-based index of an xf record contained in cellStyleXfs corresponding to the cell style applied to the cell.

Not present for xf records contained in cellStyleXfs.

The possible values for this attribute are defined by the ST_CellStyleXfId simple type (§18.18.10).

[Note: The W3C XML Schema definition of this element’s content model (CT_Xf) is located in §A.2. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CellFormat Members

DocumentFormat.OpenXml.Spreadsheet Namespace