alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class ValidationRule

    Represents a data validation rule that can be applied to a range of cells.

    Inheritance
    object
    ValidationRule
    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 ValidationRule
    Remarks

    This class contains the settings used to validate cell values, including the validation type, operator, validation values, and target range.

    Constructors

    ValidationRule()

    Declaration
    public ValidationRule()

    Properties

    IgnoreBlank

    Gets or sets a value indicating whether blank cells are ignored during validation.

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

    When set to true, blank cells are ignored during validation; otherwise, blank cells are validated. The default value is true.

    Remarks

    Use this property to control whether validation rules are applied to blank cells.

    ListSource

    Gets or sets the source of values for List-type data validation.

    Declaration
    public string ListSource { get; set; }
    Property Value
    Type Description
    string

    A string that can be comma-separated values or a cell range reference.

    Remarks

    This property is used when Type is set to List.

    Operator

    Gets or sets the operator used by the validation rule.

    Declaration
    public ValidationOperator Operator { get; set; }
    Property Value
    Type Description
    ValidationOperator

    A ValidationOperator value that specifies how cell values are evaluated. The default value is Between.

    Remarks

    The selected operator determines how cell values are compared with the specified validation values.

    Range

    Gets or sets the range to which the validation rule is applied.

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

    A string that specifies the target range for the validation rule.

    Remarks

    If no range is specified, the validation rule is applied to the currently selected range.

    ShowInCellDropdown

    Gets or sets a value indicating whether a dropdown list is displayed for list validation.

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

    When set to true, a dropdown list is displayed for list validation; otherwise, the dropdown list is hidden. The default value is true.

    Remarks

    This setting applies only when Type is set to List.

    Type

    Gets or sets the type of validation used to evaluate cell values.

    Declaration
    public ValidationType Type { get; set; }
    Property Value
    Type Description
    ValidationType

    A ValidationType value that specifies the type of validation to apply. The default value is WholeNumber.

    Remarks

    The selected validation type determines the kind of values that are allowed in cells.

    Value1

    Gets or sets the primary value used by the validation rule.

    Declaration
    public string Value1 { get; set; }
    Property Value
    Type Description
    string

    A string that specifies the primary validation value.

    Remarks

    This value is used when evaluating cell values against the validation rule.

    Value2

    Gets or sets the secondary value used by the validation rule.

    Declaration
    public string Value2 { get; set; }
    Property Value
    Type Description
    string

    A string that specifies the secondary validation value.

    Remarks

    This value is used when the selected operator requires both a starting and ending value.

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