alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class QueryBuilderRule

    Represents a single rule within a Syncfusion.Blazor.QueryBuilder.Internal.QueryBuilderGroup<T>, defining a condition, field, operator, and value.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    QueryBuilderRule
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.QueryBuilder
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class QueryBuilderRule : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    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<T> 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
    [Parameter]
    public string Condition { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    public bool IsLocked { get; set; }
    Property Value
    Type Description
    bool

    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
    [Parameter]
    public bool? Not { get; set; }
    Property Value
    Type Description
    bool?

    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
    [Parameter]
    public List<RuleModel> Rules { get; set; }
    Property Value
    Type Description
    List<RuleModel>

    A List<T> 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(bool)

    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
    bool disposing

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

    Overrides
    OwningComponentBase.Dispose(bool)

    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
    Task

    A Task representing the asynchronous operation.

    Overrides
    ComponentBase.OnInitializedAsync()

    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
    string key

    The name of the property to update.

    object result

    The new value for the property.

    Remarks

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

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved