alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ConditionalFormattingEventArgs

    Provides information about the ConditionalFormatting event, which is raised before a conditional formatting rule is applied to a cell range.

    Inheritance
    object
    ConditionalFormattingEventArgs
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Spreadsheet
    Assembly: Syncfusion.Blazor.Spreadsheet.dll
    Syntax
    public class ConditionalFormattingEventArgs
    Remarks

    This event allows you to intercept the process of applying a conditional formatting rule to a worksheet range.

    You can prevent the rule from being applied by setting the Cancel property to true.

    The event handler receives the proposed rule, the target range, and the worksheet context so subscribers can inspect or modify the operation before it executes.

    Constructors

    ConditionalFormattingEventArgs()

    Declaration
    public ConditionalFormattingEventArgs()

    Properties

    Cancel

    Gets or sets a value indicating whether the conditional formatting operation should be cancelled.

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    bool

    A bool indicating whether the operation should be cancelled. The default value is false.

    Remarks

    When set to true, the conditional formatting rule will not be applied to the worksheet.

    This property allows event handlers to prevent the default conditional formatting behavior, for example, based on validation rules or user permissions.

    Examples

    This example demonstrates how to cancel a conditional formatting operation.

    // Cancel conditional formatting on protected ranges
    void OnConditionalFormatting(ConditionalFormattingEventArgs args)
    {
        if (IsProtectedRange(args.Range))
        {
            args.Cancel = true;
        }
    }

    ConditionalFormatType

    Gets the type of conditional formatting rule being applied.

    Declaration
    public ConditionalFormatType ConditionalFormatType { get; }
    Property Value
    Type Description
    ConditionalFormatType

    A ConditionalFormatType value that determines how the rule evaluates cell values and which visual treatment is applied (for example, GreaterThan, Between, ColorScale, or BlueDataBar).

    Remarks

    This property is populated from the rule before it is applied, allowing subscribers to inspect or branch on the rule type.

    Range

    Gets the A1-style range address that the conditional formatting rule will be applied to.

    Declaration
    public string Range { get; }
    Property Value
    Type Description
    string

    A string in A1 notation (for example, "Sheet1!A1:D10" or "A1:D10"). The default value is null.

    Remarks

    The range may be a single range or a multi-range string. Only the first range is targeted for the rule's primary application; the full multi-range string is preserved on the rule itself.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved