alexa
menu

Blazor

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

    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
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    QueryBuilderOperator
    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 QueryBuilderOperator : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    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
    [Parameter]
    public bool AllowFiltering { get; set; }
    Property Value
    Type Description
    bool

    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
    [Parameter]
    public string FilterBarPlaceholder { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    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
    [Parameter]
    public EventCallback<object> OperatorDropDownClosed { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<TValue> that will be invoked when the dropdown closes. The event argument is of type 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
    [Parameter]
    public EventCallback<FilteringEventArgs> OperatorDropDownFiltering { get; set; }
    Property Value
    Type Description
    EventCallback<FilteringEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    public EventCallback<PopupEventArgs> OperatorDropDownOpened { get; set; }
    Property Value
    Type Description
    EventCallback<PopupEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    public EventCallback<BeforeOpenEventArgs> OperatorDropDownOpening { get; set; }
    Property Value
    Type Description
    EventCallback<BeforeOpenEventArgs>

    An EventCallback<TValue> 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
    [Parameter]
    public string Placeholder { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    public string PopupHeight { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    public string PopupWidth { get; set; }
    Property Value
    Type Description
    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
    [Parameter]
    public bool ShowClearButton { get; set; }
    Property Value
    Type Description
    bool

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

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

    Remarks

    The value can be specified in pixels or percentages.

    Methods

    Dispose(bool)

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

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

    Overrides
    OwningComponentBase.Dispose(bool)

    OnInitializedAsync()

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

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

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