Search Results for

    Show / Hide Table of Contents

    Class ConditionalFormatting

    The ConditionalFormatting class encapsulates all Settings of Conditional Formatting.

    Inheritance
    System.Object
    ConditionalFormatting
    Namespace: IronXL.Formatting
    Assembly: IronXL.dll
    Syntax
    public class ConditionalFormatting : Object

    Properties

    NumberOfRules

    Gets the number of rules.

    Declaration
    public int NumberOfRules { get; }
    Property Value
    Type Description
    System.Int32

    The number of rules.

    Methods

    AddRule(ConditionalFormattingRule)

    Add a Conditional Formatting rule. Excel allows to create up to 3 Conditional Formatting rules.

    Declaration
    public void AddRule(ConditionalFormattingRule cfRule)
    Parameters
    Type Name Description
    ConditionalFormattingRule cfRule

    The Conditional Formatting rule

    GetFormattingRanges()

    Returns the list of ranges to apply formatting.

    Declaration
    public List<RangeAddress> GetFormattingRanges()
    Returns
    Type Description
    System.Collections.Generic.List<RangeAddress>

    List of range addresses.

    GetRule(Int32)

    Returns the Conditional Formatting rule at specified position.

    Declaration
    public ConditionalFormattingRule GetRule(int idx)
    Parameters
    Type Name Description
    System.Int32 idx

    Position of the rule.

    Returns
    Type Description
    ConditionalFormattingRule

    The Conditional Formatting rule at specified position.

    SetRule(Int32, ConditionalFormattingRule)

    Replaces an existing Conditional Formatting rule at position idx. Excel allows to create up to 3 Conditional Formatting rules. This method can be useful to modify existing Conditional Formatting rules.

    Declaration
    public void SetRule(int idx, ConditionalFormattingRule cfRule)
    Parameters
    Type Name Description
    System.Int32 idx

    Position of the rule. Should be between 0 and 2.

    ConditionalFormattingRule cfRule

    Conditional Formatting rule

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronXL to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronXL free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.