menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DropDownListModel<TValue, TItem> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DropDownListModel<TValue, TItem>

    Represents configuration and events for the Syncfusion DropDownList component, including data-binding, filtering, popup management, and display customization.

    Inheritance
    System.Object
    DropDownListModel<TValue, TItem>
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DropDownListModel<TValue, TItem> : Object
    Type Parameters
    Name Description
    TValue

    Specifies the type of DropDownListModel.

    TItem

    Specifies the typr of value.

    Remarks

    Use the properties and event callbacks in DropDownListModel to manage all aspects of the DropDownList’s data, appearance, and user interaction patterns.

    Examples
    <SfDropDownList TValue="string" TItem="DropItem" DataSource="@items" Placeholder="Choose an item">
        <DropDownListEvents TValue="string" TItem="DropItem" Change="OnChangeHandler" />
    </SfDropDownList>

    Constructors

    DropDownListModel()

    Declaration
    public DropDownListModel()

    Properties

    ActionBegin

    Event data when remote data fetching is initiated for this DropDownList.

    Declaration
    public ActionBeginEventArgs ActionBegin { get; set; }
    Property Value
    Type Description
    ActionBeginEventArgs

    An ActionBeginEventArgs instance for fetch initiation.

    ActionComplete

    Event data for when remote data fetching is complete.

    Declaration
    public ActionCompleteEventArgs ActionComplete { get; set; }
    Property Value
    Type Description
    ActionCompleteEventArgs

    An ActionCompleteEventArgs object containing completion metadata.

    ActionFailure

    Callback for errors or fail scenarios when fetching data from remote sources.

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

    The EventCallback<object> for handling data fetch failures.

    ActionFailureTemplate

    Template displayed on failure to fetch remote data for the popup list.

    Declaration
    public RenderFragment ActionFailureTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Set as a Microsoft.AspNetCore.Components.RenderFragment.

    AllowFiltering

    Controls whether to show the search box/filter bar.

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

    true to show the search box. false (default) hides it.

    Remarks

    Requires AllowFiltering to be set. Triggers Filtering event as users type.

    BeforeOpen

    Arguments raised immediately before the popup opens.

    Declaration
    public BeforeOpenEventArgs BeforeOpen { get; set; }
    Property Value
    Type Description
    BeforeOpenEventArgs

    A BeforeOpenEventArgs instance with relevant data.

    Blur

    Callback triggered when input focus moves out of the DropDownList.

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

    Use EventCallback<object> to handle blur/validation logic.

    Change

    Callback when a DropDownList item is selected or value changes via user interaction.

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

    Use this for cascading lists, custom value change reactions, or analytics.

    Examples
    @code { void OnChangeHandler(object args) {/*...*/} }

    Close

    Callback after the popup closes.

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

    EventCallback<object> used to reset state, run analytics, or trigger UI logic after popup dismissal.

    Created

    Callback after the component is initialized and created.

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

    This event is useful for executing post-initialization logic or startup configuration.

    CssClass

    Custom CSS class(es) added to the DropDownList root element for styling.

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

    Class names as string. null by default.

    DataBound

    Arguments provided when binding data to DropDownList completes.

    Declaration
    public DataBoundEventArgs DataBound { get; set; }
    Property Value
    Type Description
    DataBoundEventArgs

    A DataBoundEventArgs instance with completion info.

    DataSource

    Collection of items or a data manager instance to bind to the DropDownList.

    Declaration
    public IEnumerable<TItem> DataSource { get; set; }
    Property Value
    Type
    System.Collections.Generic.IEnumerable<TItem>
    Remarks

    Ignored from serialization.

    DebounceDelay

    Milliseconds to wait after user types before filtering/search logic starts. Applies with AllowFiltering.

    Declaration
    public int DebounceDelay { get; set; }
    Property Value
    Type Description
    System.Int32

    int value. Default is 300.

    Destroyed

    Callback when the DropDownList is destroyed/disposed.

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

    Use for code cleanup or reporting unmount/teardown.

    Enabled

    Sets whether user interaction is enabled or disabled for this DropDownList.

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

    true (default) for enabled. false disables all interaction.

    EnableRtl

    Enable right-to-left (RTL) rendering of DropDownList (used in RTL locales).

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

    true enables RTL. Default is false.

    EnableVirtualization

    Enable virtual scrolling for large-data DropDownList performance (fetch on scroll, partial view, etc).

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

    true enables partial-view fetch; false disables.

    Remarks

    Highly recommended for lists exceeding 1000 items.

    FilterBarPlaceholder

    Placeholder watermarked text shown in the filter bar (search box), if visible.

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

    String specifying search placeholder. null for no placeholder.

    Filtering

    Callback triggered during filter bar text input if AllowFiltering is enabled.

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

    Bind custom filtering, search, or logics with EventCallback<object>.

    FilterType

    Specifies the filter search type: StartsWith, Contains, etc.

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

    A FilterType enum value.

    FloatLabelType

    Controls floating label UI behavior for placeholder text.

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

    Never, Always, or Auto. Default: Never.

    Focus

    Callback when the DropDownList receives focus.

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

    Useful for accessibility, keyboard navigation, or showing hints.

    FooterTemplate

    Template for customizing the popup footer content.

    Declaration
    public RenderFragment FooterTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Set as a RenderFragment.

    HeaderTemplate

    Template for customizing the popup header content.

    Declaration
    public RenderFragment HeaderTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Set as a Microsoft.AspNetCore.Components.RenderFragment.

    HtmlAttributes

    Additional input HTML attributes set on the DropDownList root element.

    Declaration
    public object HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Object

    Properties such as disabled or value.

    Remarks

    When both a property and attribute are set, the property’s value is used.

    IgnoreAccent

    If true, diacritics/accented character differences are ignored during search (default: false).

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

    true to ignore; false to match on accents.

    IgnoreCase

    If true, string searches ignore case (default: true).

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

    true for case-insensitive; false to match case.

    Index

    Index of the currently selected list item. 0 for first item by default.

    Declaration
    public int Index { get; set; }
    Property Value
    Type Description
    System.Int32

    Integer with the zero-based selected index.

    Open

    Callback when the popup opens on this DropDownList.

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

    Use for analytics or asynchronous UI preparations.

    Placeholder

    Placeholder hint or watermark text, shown until the user interacts or selects a value.

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

    Hint or placeholder string.

    Remarks

    Displayed based on FloatLabelType setting.

    PopupDisplayMode

    Controls the display mode for the popup (e.g., FullScreen, etc).

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

    A PopupDisplayMode value (default: FullScreen).

    PopupHeight

    Height of the suggestion popup (default: auto).

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

    Accepts any CSS length unit or auto.

    PopupWidth

    Width of the suggestion popup. By default, matches the DropDownList width.

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

    Accepts any CSS length unit.

    Query

    External query object used for customizing remote data and filtering.

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

    Custom query object or null.

    Readonly

    Determines if the DropDownList is in readonly mode.

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

    true to lock value. false (default) for normal operation.

    Remarks

    Readonly disables value changes without disabling component focus or keyboard navigation.

    Select

    Callback when an item is selected via mouse, tap, or keyboard.

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

    EventCallback<object> for item selection events.

    ShowClearButton

    If true, a clear button appears, which clears Value, Text, and Index.

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

    Set to true for clear-button UI; false disables.

    Text

    Text to display in the input when an item is selected.

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

    Current selection’s display text.

    Value

    Value of the currently selected item.

    Declaration
    public TValue Value { get; set; }
    Property Value
    Type
    TValue

    ValueTemplate

    Template for customizing how the selected value is presented in the DropDownList input.

    Declaration
    public RenderFragment<TValue> ValueTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment<TValue>

    Set as a Microsoft.AspNetCore.Components.RenderFragment<>.

    Width

    Sets the width of this DropDownList (CSS px, %, rem, etc). Default: auto.

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

    Width string or null for auto.

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