menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class QueryBuilderRule - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class QueryBuilderRule

    Represents a single rule within a Syncfusion.Blazor.QueryBuilder.Internal.QueryBuilderGroup`1, defining a condition, field, operator, and value.

    Inheritance
    System.Object
    QueryBuilderRule
    Namespace: Syncfusion.Blazor.QueryBuilder
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class QueryBuilderRule : OwningComponentBase
    Remarks

    A rule is the most basic component of a query, specifying a single condition that must be met. Multiple rules can be combined within a Syncfusion.Blazor.QueryBuilder.Internal.QueryBuilderGroup`1 to create complex queries.

    Examples
    <SfQueryBuilder>
        <QueryBuilderColumns>
            <QueryBuilderColumn Field="EmployeeID" Label="Employee ID" Type="ColumnType.Number"></QueryBuilderColumn>
            <QueryBuilderColumn Field="FirstName" Label="First Name" Type="ColumnType.String"></QueryBuilderColumn>
        </QueryBuilderColumns>
        <QueryBuilderRule>
             <Rules>
                 <RuleModel Field="EmployeeID" Label="Employee ID" Operator="equal" Type="number" Value=1 />
             </Rules>
        </QueryBuilderRule>
    </SfQueryBuilder>

    Constructors

    QueryBuilderRule()

    Declaration
    public QueryBuilderRule()

    Properties

    Condition

    Gets or sets the logical condition (e.g., "and" or "or") for the group of rules.

    Declaration
    public string Condition { get; set; }
    Property Value
    Type Description
    System.String

    A string that represents the condition. The default value is "and".

    Remarks

    This property determines how the rules within this component are combined.

    IsLocked

    Gets or sets a value indicating whether the rule or group is locked, preventing user modification.

    Declaration
    public bool IsLocked { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the rule is locked; otherwise, false. The default value is false.

    Remarks

    A locked rule cannot be edited or deleted by the user through the UI.

    Not

    Gets or sets a value indicating whether to apply a "not" condition to the entire group.

    Declaration
    public Nullable<bool> Not { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    true if the "not" condition is applied; otherwise, false. The default is false.

    Remarks

    When set to true, the entire group of rules is negated.

    Rules

    Gets or sets the collection of individual rules within this group.

    Declaration
    public List<RuleModel> Rules { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<RuleModel>

    A System.Collections.Generic.List<> of RuleModel objects. The default value is an empty list.

    Remarks

    Each RuleModel in this list represents a single condition in the query.

    Methods

    Dispose(Boolean)

    Releases the unmanaged resources used by the QueryBuilderRule and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    UpdateChildProperties(String, Object)

    Updates the child properties of the component based on the provided key and value.

    Declaration
    public void UpdateChildProperties(string key, object result)
    Parameters
    Type Name Description
    System.String key

    The name of the property to update.

    System.Object result

    The new value for the property.

    Remarks

    This method is internally used to update properties like Rules, Not, IsLocked, and Condition.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved