共用方式為


ConditionalFormatting Class

Defines the ConditionalFormatting Class.This class is only available in Office2010.When the object is serialized out as xml, its qualified name is x14:conditionalFormatting.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Office2010.Excel.ConditionalFormatting

Namespace:  DocumentFormat.OpenXml.Office2010.Excel
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ConditionalFormattingRule), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ReferenceSequence))> _
<ChildElementInfoAttribute(GetType(ExtensionList), FileFormatVersions.Office2010)> _
Public Class ConditionalFormatting _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ConditionalFormatting
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ConditionalFormattingRule), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ReferenceSequence))]
[ChildElementInfoAttribute(typeof(ExtensionList), FileFormatVersions.Office2010)]
public class ConditionalFormatting : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • ConditionalFormattingRule <x14:cfRule>

  • DocumentFormat.OpenXml.Office.Excel.ReferenceSequence <xne:sqref>

  • ExtensionList <x14:extLst>

2.6.2 CT_ConditionalFormatting

Target namespace: https://schemas.microsoft.com/office/spreadsheetml/2010/main

Referenced by: CT_ConditionalFormattings

This complex type specifies conditional formatting properties for a range.

Child Elements:

cfRule : A CT_CfRule element that specifies a conditional formatting rule for this range.

xm:sqref : An sqref element that specifies the range this conditional formatting applies to.

extLst : A CT_ExtensionList ([ISO/IEC-29500-4] section A.2) element that specifies future extensibility for this element.

Attributes:

pivot : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether this conditional formatting is applied only to a PivotTable . MUST be a value from the following table:

Value

Meaning

TRUE

The area specified by sqref only includes cells that are part of a PivotTable data area.

FALSE

The area specified by sqref includes cells that are not part of a PivotTable data area.

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this complex type.

<xsd:complexType name="CT_ConditionalFormatting">

<xsd:sequence>

<xsd:element name="cfRule" type="CT_CfRule" minOccurs="0" maxOccurs="unbounded"/>

<xsd:element ref="xm:sqref" minOccurs="0" maxOccurs="1"/>

<xsd:element name="extLst" minOccurs="0" type="x:CT_ExtensionList"/>

</xsd:sequence>

<xsd:attribute name="pivot" type="xsd:boolean" default="false" use="optional"/>

</xsd:complexType>

See section 5.3 for the full W3C XML Schema ([XMLSCHEMA1] section 2.1).

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

ConditionalFormatting Members

DocumentFormat.OpenXml.Office2010.Excel Namespace