alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class ListBoxModel<T>

    Represents configuration and events for the Syncfusion ListBox component. Exposes properties for data-binding, filtering, drag-and-drop, selection, and customization, as well as event callbacks for all critical ListBox lifecycle events.

    Inheritance
    object
    ListBoxModel<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ListBoxModel<T>
    Type Parameters
    Name
    T
    Remarks

    Use ListBoxModel and its event callbacks to tailor ListBox behavior, appearance, and interaction patterns for your application's needs.

    Examples
    <SfListBox TItem="ListBoxData" TValue="string" DataSource="@MyList" AllowFiltering="true" MaximumSelectionLength="3">
      <ListBoxEvents OnChange="OnSelectionChanged" />
    </SfListBox>

    Constructors

    ListBoxModel()

    Declaration
    public ListBoxModel()

    Properties

    ActionBegin

    Event data when remote data fetch is initiated for the ListBox component.

    Declaration
    [JsonPropertyName("actionBegin")]
    public ActionBeginEventArgs ActionBegin { get; set; }
    Property Value
    Type Description
    ActionBeginEventArgs

    An ActionBeginEventArgs instance containing event parameters.

    ActionComplete

    Event data for when remote data fetching completes successfully.

    Declaration
    [JsonPropertyName("actionComplete")]
    public ActionCompleteEventArgs ActionComplete { get; set; }
    Property Value
    Type Description
    ActionCompleteEventArgs

    An ActionCompleteEventArgs for data fetch completion.

    ActionFailure

    Callback triggered when a remote fetch request fails.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("actionFailure")]
    public EventCallback<object> ActionFailure { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    Use EventCallback<object> for processing error state or retry logic.

    AllowDragAndDrop

    If true, enables drag-and-drop of ListBox items. Items can be moved within a list and between lists with the same scope.

    Declaration
    [JsonPropertyName("allowDragAndDrop")]
    public bool AllowDragAndDrop { get; set; }
    Property Value
    Type Description
    bool

    true to enable drag-and-drop; otherwise, false.

    AllowFiltering

    If true, enables the input filter search box for the ListBox component.

    Declaration
    [JsonPropertyName("allowFiltering")]
    public bool AllowFiltering { get; set; }
    Property Value
    Type Description
    bool

    true to enable filtering (default: false).

    Remarks

    When enabled, typing in the filter box triggers the Filtering event. If no results match, noRecordsTemplate is shown.

    BeforeDrop

    Callback raised before dragging/dropping an item onto another.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("beforeDrop")]
    public EventCallback<object> BeforeDrop { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    Event fired before drop event. Useful for canceling or preparing custom operations.

    BeforeItemRender

    Callback triggered while each item is rendered. Use to apply custom logic or classes per item.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("beforeItemRender")]
    public EventCallback<object> BeforeItemRender { get; set; }
    Property Value
    Type
    EventCallback<object>

    Change

    Callback triggered on selection or deselection of list items.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("change")]
    public EventCallback<object> Change { get; set; }
    Property Value
    Type
    EventCallback<object>
    Remarks

    Listen to this event for model updates or further item actions on select/deselect.

    Created

    Callback triggered when the ListBox component is initialized and ready.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("created")]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type
    EventCallback<object>

    CssClass

    CSS class or classes for customizing the ListBox root element style.

    Declaration
    [JsonPropertyName("cssClass")]
    public string CssClass { get; set; }
    Property Value
    Type Description
    string

    Use any valid CSS string for theming.

    Destroyed

    Callback when the component is disposed or destroyed. Use for cleanup or analytics.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("destroyed")]
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type
    EventCallback<object>

    Drag

    Callback triggered while the component's item is being dragged.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("drag")]
    public EventCallback<object> Drag { get; set; }
    Property Value
    Type
    EventCallback<object>

    DragStart

    Callback triggered after dragging the list item operation completes.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("dragStart")]
    public EventCallback<object> DragStart { get; set; }
    Property Value
    Type
    EventCallback<object>

    Drop

    Callback after a drop operation completes, for custom logic post-drop between ListBoxes.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("drop")]
    public EventCallback<object> Drop { get; set; }
    Property Value
    Type
    EventCallback<object>

    EnableRtl

    Set to true to enable RTL (right-to-left) rendering for ListBox content.

    Declaration
    [JsonPropertyName("enableRtl")]
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    bool

    Enable RTL by setting true; false for default LTR.

    Filtering

    Callback during filter input typing in the ListBox.

    Declaration
    [JsonIgnore]
    [JsonPropertyName("filtering")]
    public EventCallback<object> Filtering { get; set; }
    Property Value
    Type
    EventCallback<object>
    Remarks

    Use for providing dynamic or server-side filtering as user types.

    Height

    Height specification for the ListBox component. Use pixel, %, or CSS units.

    Declaration
    [JsonPropertyName("height")]
    public object Height { get; set; }
    Property Value
    Type Description
    object

    Height as object (string/CSS value/number).

    MaximumSelectionLength

    Set the maximum number of items that may be selected by the user.

    Declaration
    [JsonPropertyName("maximumSelectionLength")]
    public double MaximumSelectionLength { get; set; }
    Property Value
    Type Description
    double

    Defaults to 1000.

    Remarks

    After reaching this limit, additional selection is blocked.

    Scope

    Value used for grouping ListBoxes for cross-list drag-and-drop. ListBoxes with the same Scope allow moving items between each other.

    Declaration
    [JsonPropertyName("scope")]
    public string Scope { get; set; }
    Property Value
    Type Description
    string

    Defaults to empty string.

    SelectionSettings

    Selection options including mode (single/multiple) and checkbox controls.

    Declaration
    [JsonPropertyName("selectionSettings")]
    public SelectionSettingsModel SelectionSettings { get; set; }
    Property Value
    Type Description
    SelectionSettingsModel

    A SelectionSettingsModel specifying selection configuration.

    ToolbarSettings

    Toolbar options for ListBox dual-list tools (move up/down/all, etc) and toolbar position.

    Declaration
    [JsonPropertyName("toolbarSettings")]
    public ToolbarSettingsModel ToolbarSettings { get; set; }
    Property Value
    Type Description
    ToolbarSettingsModel

    A ToolbarSettingsModel for toolbar configuration.

    Value

    Gets or sets or returns the current value or selected state in the ListBox.

    Declaration
    [JsonPropertyName("value")]
    public T Value { get; set; }
    Property Value
    Type Description
    T

    The value type parameter T specifying the ListBox’s selected item(s).

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