Table of Contents

Class ExcelConditionalFormatCellIsAttribute

Namespace
BigExcelCreator.ClassAttributes
Assembly
BigExcelCreator.dll

Adds a conditional formatting rule based on a cell value (CellIs)

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
[CLSCompliant(false)]
public sealed class ExcelConditionalFormatCellIsAttribute : Attribute
Inheritance
ExcelConditionalFormatCellIsAttribute
Inherited Members

Constructors

ExcelConditionalFormatCellIsAttribute(int, ConditionalFormattingOperatorValues, string, string)

Adds a conditional formatting rule based on a cell value (CellIs) with the specified format, operator, and comparison values.

public ExcelConditionalFormatCellIsAttribute(int format, ConditionalFormattingOperatorValues @operator, string value, string value2 = null)

Parameters

format int

The index of the conditional format to apply when the condition is met.

operator ConditionalFormattingOperatorValues

The comparison operator used to evaluate the cell value.

value string

The first value to compare against the cell value. Cannot be null.

value2 string

The second value to compare against the cell value, used for operators that require two values. Optional; may be null for single-value operators.

ExcelConditionalFormatCellIsAttribute(string, ConditionalFormattingOperatorValues, string, string)

Adds a conditional formatting rule based on a cell value (CellIs) with the specified format, operator, and comparison values.

public ExcelConditionalFormatCellIsAttribute(string styleName, ConditionalFormattingOperatorValues @operator, string value, string value2 = null)

Parameters

styleName string

The name of the style to apply when the conditional formatting rule is met. Cannot be null or empty.

operator ConditionalFormattingOperatorValues

The comparison operator used to evaluate the cell's value against the specified criteria.

value string

The first value to compare the cell's value against, according to the specified operator. Cannot be null.

value2 string

The second value to use for comparison when the operator requires two values; otherwise, null.

Properties

Format

The format ID of the differential format in styleSheet to apply when the condition is met. See GetIndexDifferentialByName(string).

public int Format { get; }

Property Value

int

Operator

The operator to use for the conditional formatting rule.

public ConditionalFormattingOperatorValues Operator { get; }

Property Value

ConditionalFormattingOperatorValues

StyleName

The differential style name to apply to the cell.

public string StyleName { get; }

Property Value

string

Value

The value to compare the cell value against.

public string Value { get; }

Property Value

string

Value2

The second value to compare the cell value against, used for "Between" and "NotBetween" operators.

public string Value2 { get; }

Property Value

string