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

    Show / Hide Table of Contents

    ContainValueCondition Class

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

    Represents a condition that formats only cells with value that satisfies the specified criteria.

    • C#
    • VB.NET
    public sealed class ContainValueCondition : ContainCondition
    Public NotInheritable Class ContainValueCondition
        Inherits ContainCondition
    Inheritance:
    System.Object
    FormatCondition
    ContainCondition
    ContainValueCondition

    Properties

    Operator

    Gets or sets the operator of this ContainValueCondition.

    • C#
    • VB.NET
    public ContainValueOperator Operator { get; set; }
    Public Property Operator As ContainValueOperator
    Property Value
    ContainValueOperator

    The operator of this ContainValueCondition.

    Value

    Gets or sets the value of this ContainValueCondition.

    Value can be either constant or formula.

    If value is constant, then it cannot be null and value's type must be supported in Value (types supported in SupportsType(Type)).

    If value is formula, then value type must be System.String and it must start with '='.

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

    The value of this ContainValueCondition.

    Exceptions
    System.ArgumentNullException

    Value is null.

    System.ArgumentException

    Value's type is not supported.

    Value2

    Gets or sets the second value of this ContainValueCondition used with Between and NotBetween operators.

    Value can be either constant or formula.

    If value is constant, then it cannot be null and value's type must be supported in Value (types supported in SupportsType(Type)).

    If value is formula, then value type must be System.String and it must start with '='.

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

    The second value of this ContainValueCondition used with Between and NotBetween operators.

    Exceptions
    System.ArgumentNullException

    Value is null and Operator is Between or NotBetween.

    System.ArgumentException

    Value's type is not supported.

    Methods

    ToString()

    Returns a System.String that represents this ContainValueCondition instance.

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

    A System.String that represents this ContainValueCondition instance.

    Overrides
    ContainCondition.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).

    Inherited Properties

    ConditionType

    Gets the Contain value.

    (Inherited from ContainCondition)

    ContainConditionType

    Gets the ContainCondition type.

    (Inherited from ContainCondition)

    Rule

    Gets the conditional formatting rule associated with this condition.

    (Inherited from FormatCondition)

    Style

    Gets the actual formatting which will be applied to a cell if its value satisfies this ContainCondition.

    (Inherited from ContainCondition)

    Examples

    Excel Conditional Formatting example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.