menu

Blazor

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

    Show / Hide Table of Contents

    Class QueryBuilderOperator

    Specifies the operator model of the SfQueryBuilder<TValue> component, which is used to customize the operator dropdown list.

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

    You can customize properties such as filtering, popup width and height, and the width of the operator dropdown list by specifying values to the corresponding properties.

    Examples

    In the following code example, the operator dropdown list is customized using the QueryBuilderOperator tag directive.

    <SfQueryBuilder TValue="Employee">
    <QueryBuilderOperator AllowFiltering="true"></QueryBuilderOperator>
    <QueryBuilderColumns>
    <QueryBuilderColumn Field="CustomerID" Label="CustomerID" Type="ColumnType.String" Operator="equal">
    </QueryBuilderColumn>
    <QueryBuilderColumn Field="EmployeeID" Label="EmployeeID" Type="ColumnType.Number"></QueryBuilderColumn>
    </QueryBuilderColumns>
    </SfQueryBuilder>

    Constructors

    QueryBuilderOperator()

    Declaration
    public QueryBuilderOperator()

    Properties

    AllowFiltering

    Gets or sets a value indicating whether to enable or disable the filtering option in the operator dropdown list.

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

    If set to true, the filtering option is enabled in the operator dropdown list. The default value is false.

    Remarks

    When filtering is enabled, a search box is displayed in the operator dropdown, allowing users to filter the available operators.

    FilterBarPlaceholder

    Gets or sets the placeholder text for the filter bar in the operator dropdown list.

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

    A string that represents the placeholder text. The default value is "Select a Operator".

    Remarks

    This placeholder is displayed in the filter input box when it is empty.

    FilterType

    Gets or sets the filter type for the operator dropdown list.

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

    One of the FilterType enumerations. The default value is StartsWith.

    Remarks

    The available filter types are:

    • StartsWithFilters items that start with the entered text.
    • EndsWithFilters items that end with the entered text.
    • ContainsFilters items that contain the entered text.

    OperatorDropDownClosed

    Gets or sets an event callback that is raised when the operator dropdown list is closed.

    Declaration
    public EventCallback<object> OperatorDropDownClosed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An Microsoft.AspNetCore.Components.EventCallback<> that will be invoked when the dropdown closes. The event argument is of type System.Object.

    Remarks

    This event allows you to perform actions after the dropdown has been closed.

    Examples

    In the following code example, the OperatorDropDownClosed event is demonstrated.

    <SfQueryBuilder TValue="Employee">
    <QueryBuilderOperator OperatorDropDownClosed="OnClosed"></QueryBuilderOperator>
    <QueryBuilderColumns>
    <QueryBuilderColumn Field="CustomerID" Label="CustomerID" Type="ColumnType.String">
    </QueryBuilderColumn>
    <QueryBuilderColumn Field="EmployeeID" Label="EmployeeID" Type="ColumnType.Number"></QueryBuilderColumn>
    </QueryBuilderColumns>
    </SfQueryBuilder>
    @code {
    private void OnClosed(object args)
    {
         // Your custom logic here.
    }
    }

    OperatorDropDownFiltering

    Gets or sets an event callback that is raised when filtering the operator dropdown list.

    Declaration
    public EventCallback<FilteringEventArgs> OperatorDropDownFiltering { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that will be invoked during filtering. The event arguments are of type FilteringEventArgs.

    Remarks

    This event allows for custom filtering logic to be implemented.

    Examples
    <SfQueryBuilder TValue="Employee">
    <QueryBuilderOperator OperatorDropDownFiltering="OnFiltering"></QueryBuilderOperator>
    <QueryBuilderColumns>
    <QueryBuilderColumn Field="CustomerID" Label="CustomerID" Type="ColumnType.String">
    </QueryBuilderColumn>
    </QueryBuilderColumns>
    </SfQueryBuilder>
    @code {
    private void OnFiltering(Syncfusion.Blazor.DropDowns.FilteringEventArgs args)
    {
         // Your custom filtering logic here.
    }
    }

    OperatorDropDownOpened

    Gets or sets an event callback that is raised after the operator dropdown list has opened.

    Declaration
    public EventCallback<PopupEventArgs> OperatorDropDownOpened { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that will be invoked after the dropdown opens. The event arguments are of type PopupEventArgs.

    Remarks

    This event can be used to perform actions after the dropdown is visible.

    Examples

    In the below code example, the OperatorDropDownOpened event is used.

    <SfQueryBuilder TValue="Employee">
    <QueryBuilderOperator OperatorDropDownOpened="Opened"></QueryBuilderOperator>
    <QueryBuilderColumns>
    <QueryBuilderColumn Field="CustomerID" Label="CustomerID" Type=Syncfusion.Blazor.QueryBuilder.ColumnType.String Values="values">
    </QueryBuilderColumn>
    <QueryBuilderColumn Field="EmployeeID" Label="EmployeeID" Type=Syncfusion.Blazor.QueryBuilder.ColumnType.Number></QueryBuilderColumn>
    </QueryBuilderColumns>
    </SfQueryBuilder>
    @code {
    private void Opened(Syncfusion.Blazor.DropDowns.PopupEventArgs args)
    {
         // Your custom logic here.
    }
    }

    OperatorDropDownOpening

    Gets or sets an event callback that is raised when the operator dropdown list is about to open.

    Declaration
    public EventCallback<BeforeOpenEventArgs> OperatorDropDownOpening { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<BeforeOpenEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that will be invoked before the dropdown opens. The event arguments are of type BeforeOpenEventArgs.

    Remarks

    This event can be used to customize the dropdown list before it is displayed or to prevent it from opening.

    Examples

    In the below code example, the OperatorDropDownOpening event is used.

    <SfQueryBuilder TValue="Employee">
    <QueryBuilderOperator OperatorDropDownOpening="OperatorDropDownOpening"></QueryBuilderOperator>
    <QueryBuilderColumns>
    <QueryBuilderColumn Field="CustomerID" Label="CustomerID" Type=Syncfusion.Blazor.QueryBuilder.ColumnType.String Values="values">
    </QueryBuilderColumn>
    <QueryBuilderColumn Field="EmployeeID" Label="EmployeeID" Type=Syncfusion.Blazor.QueryBuilder.ColumnType.Number></QueryBuilderColumn>
    </QueryBuilderColumns>
    </SfQueryBuilder>
    @code {
    private void OperatorDropDownOpening(Syncfusion.Blazor.DropDowns.BeforeOpenEventArgs args)
    {
         // Your custom logic here.
    }
    }

    Placeholder

    Gets or sets the placeholder text for the operator dropdown list.

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

    A string that represents the placeholder text. The default value is "Select a Operator".

    Remarks

    This placeholder is displayed when no operator is selected.

    PopupHeight

    Gets or sets the height of the operator dropdown list's popup.

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

    A string representing the popup height. The default value is "200px".

    Remarks

    The value can be specified in pixels or percentages.

    PopupWidth

    Gets or sets the width of the operator dropdown list's popup.

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

    A string representing the popup width. The default value is "100%".

    Remarks

    The value can be specified in pixels or percentages.

    ShowClearButton

    Gets or sets a value indicating whether to show the clear button in the operator dropdown list.

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

    If set to true, the clear button is displayed. The default value is false.

    Remarks

    The clear button allows users to quickly clear the selected operator.

    Width

    Gets or sets the width of the operator dropdown list.

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

    A string representing the width. The default value is "100%".

    Remarks

    The value can be specified in pixels or percentages.

    Methods

    Dispose(Boolean)

    Releases the unmanaged resources used by the component 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()

    Initializes the component and updates the parent SfQueryBuilder<TValue> with its properties.

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

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

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