GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ConditionalValue Struct

    Namespace:
    GemBox.Spreadsheet.ConditionalFormatting
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a conditional value used in conditional formatting rules which format all cells based on their values (ColorScaleCondition, DataBarCondition and IconSetCondition).

    • C#
    • VB.NET
    public struct ConditionalValue : IEquatable<ConditionalValue>
    Public Structure ConditionalValue
        Implements IEquatable(Of ConditionalValue)
    Implements
    System.IEquatable<ConditionalValue>

    Fields

    Automatic

    Gets the ConditionalValue instance whose ValueType is equal to Automatic.

    • C#
    • VB.NET
    public static readonly ConditionalValue Automatic
    Public Shared ReadOnly Automatic As ConditionalValue
    Field Value
    ConditionalValue

    Highest

    Gets the ConditionalValue instance whose ValueType is equal to Highest.

    • C#
    • VB.NET
    public static readonly ConditionalValue Highest
    Public Shared ReadOnly Highest As ConditionalValue
    Field Value
    ConditionalValue

    Lowest

    Gets the ConditionalValue instance whose ValueType is equal to Lowest.

    • C#
    • VB.NET
    public static readonly ConditionalValue Lowest
    Public Shared ReadOnly Lowest As ConditionalValue
    Field Value
    ConditionalValue

    None

    Gets the ConditionalValue instance whose ValueType is equal to None.

    • C#
    • VB.NET
    public static readonly ConditionalValue None
    Public Shared ReadOnly None As ConditionalValue
    Field Value
    ConditionalValue

    Properties

    Value

    Gets the value.

    • C#
    • VB.NET
    public readonly object Value { get; }
    Public ReadOnly Property Value As Object
    Property Value
    System.Object

    The value.

    Remarks

    Value is

    • equal to null if ValueType is equal to None, Automatic, Lowest or Highest.
    • System.Double or System.String if ValueType is equal to Number, Percent or Percentile. The value is System.Double if it represents constant value and System.String if it represents formula.
    • System.String if ValueType is equal to Formula.

    ValueType

    Gets the conditional value type.

    • C#
    • VB.NET
    public readonly ConditionalValueType ValueType { get; }
    Public ReadOnly Property ValueType As ConditionalValueType
    Property Value
    ConditionalValueType

    The conditional value type.

    Methods

    Equals(ConditionalValue)

    Determines whether the other ConditionalValue is equal to this ConditionalValue instance.

    • C#
    • VB.NET
    public bool Equals(ConditionalValue other)
    Public Function Equals(other As ConditionalValue) As Boolean
    Parameters
    other
    ConditionalValue

    The other ConditionalValue to compare with this ConditionalValue instance.

    Returns
    System.Boolean

    true if the other ConditionalValue is equal to this ConditionalValue instance; otherwise, false.

    Equals(Object)

    Determines whether the specified System.Object is equal to this ConditionalValue instance.

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this ConditionalValue instance.

    Returns
    System.Boolean

    true if the specified System.Object is a ConditionalValue and is equal to this ConditionalValue instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)

    FromFormula(String)

    Creates a new instance of the ConditionalValue from the specified formula.

    • C#
    • VB.NET
    public static ConditionalValue FromFormula(string formula)
    Public Shared Function FromFormula(formula As String) As ConditionalValue
    Parameters
    formula
    System.String

    The formula value.

    Returns
    ConditionalValue

    A new instance of the ConditionalValue whose ValueType is equal to Formula and Value is equal to formula parameter.

    Exceptions
    System.ArgumentException

    Formula value is null or System.String.Empty.

    FromNumber(Double)

    Creates a new instance of the ConditionalValue from the specified number.

    • C#
    • VB.NET
    public static ConditionalValue FromNumber(double number)
    Public Shared Function FromNumber(number As Double) As ConditionalValue
    Parameters
    number
    System.Double

    The number value.

    Returns
    ConditionalValue

    A new instance of the ConditionalValue whose ValueType is equal to Number and Value is equal to number parameter.

    FromPercent(Double)

    Creates a new instance of the ConditionalValue from the specified percent.

    • C#
    • VB.NET
    public static ConditionalValue FromPercent(double percent)
    Public Shared Function FromPercent(percent As Double) As ConditionalValue
    Parameters
    percent
    System.Double

    The percent value.

    Returns
    ConditionalValue

    A new instance of the ConditionalValue whose ValueType is equal to Percent and Value is equal to percent parameter.

    Exceptions
    System.ArgumentOutOfRangeException

    Percent value is less than 0 or greater than 100.

    FromPercentile(Double)

    Creates a new instance of the ConditionalValue from the specified percentile.

    • C#
    • VB.NET
    public static ConditionalValue FromPercentile(double percentile)
    Public Shared Function FromPercentile(percentile As Double) As ConditionalValue
    Parameters
    percentile
    System.Double

    The percentile value.

    Returns
    ConditionalValue

    A new instance of the ConditionalValue whose ValueType is equal to Percentile and Value is equal to percentile parameter.

    Exceptions
    System.ArgumentOutOfRangeException

    Percentile value is less than 0 or greater than 100.

    GetHashCode()

    Returns a hash code for this ConditionalValue instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this ConditionalValue instance.

    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Returns a System.String that represents this ConditionalValue instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this ConditionalValue instance.

    Overrides
    System.ValueType.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Operators

    Equality(ConditionalValue, ConditionalValue)

    Determines whether first and second ConditionalValues are equal.

    • C#
    • VB.NET
    public static bool operator ==(ConditionalValue first, ConditionalValue second)
    Public Shared Operator =(first As ConditionalValue, second As ConditionalValue) As Boolean
    Parameters
    first
    ConditionalValue

    The first ConditionalValue.

    second
    ConditionalValue

    The second ConditionalValue.

    Returns
    System.Boolean

    true if first and second ConditionalValues are equal; otherwise, false.

    Inequality(ConditionalValue, ConditionalValue)

    Determines whether first and second ConditionalValues are not equal.

    • C#
    • VB.NET
    public static bool operator !=(ConditionalValue first, ConditionalValue second)
    Public Shared Operator <>(first As ConditionalValue, second As ConditionalValue) As Boolean
    Parameters
    first
    ConditionalValue

    The first ConditionalValue.

    second
    ConditionalValue

    The second ConditionalValue.

    Returns
    System.Boolean

    true if first and second ConditionalValues are not equal; otherwise, false.

    Implements

    System.IEquatable<T>

    Examples

    Excel Conditional Formatting example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.