alexa
menu

Blazor

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

    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
    object
    DropDownListModel<TValue, TItem>
    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 DropDownListModel<TValue, TItem>
    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
    [JsonPropertyName("actionBegin")]
    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
    [JsonPropertyName("actionComplete")]
    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
    [JsonIgnore]
    [JsonPropertyName("actionFailure")]
    public EventCallback<object> ActionFailure { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    The EventCallback<object> for handling data fetch failures.

    ActionFailureTemplate

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

    Declaration
    [JsonPropertyName("actionFailureTemplate")]
    public RenderFragment ActionFailureTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment

    Set as a RenderFragment.

    AllowFiltering

    Controls whether to show the search box/filter bar.

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

    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
    [JsonPropertyName("beforeOpen")]
    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
    [JsonIgnore]
    [JsonPropertyName("blur")]
    public EventCallback<object> Blur { get; set; }
    Property Value
    Type Description
    EventCallback<object>

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

    Change

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("change")]
    public EventCallback<object> Change { get; set; }
    Property Value
    Type
    EventCallback<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
    [JsonIgnore]
    [JsonPropertyName("close")]
    public EventCallback<object> Close { get; set; }
    Property Value
    Type Description
    EventCallback<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
    [JsonIgnore]
    [JsonPropertyName("created")]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<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
    [JsonPropertyName("cssClass")]
    public string CssClass { get; set; }
    Property Value
    Type Description
    string

    Class names as string. null by default.

    DataBound

    Arguments provided when binding data to DropDownList completes.

    Declaration
    [JsonPropertyName("dataBound")]
    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
    [JsonPropertyName("dataSource")]
    [JsonIgnore]
    public IEnumerable<TItem> DataSource { get; set; }
    Property Value
    Type
    IEnumerable<TItem>
    Remarks

    Ignored from serialization.

    DebounceDelay

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

    Declaration
    [JsonPropertyName("debounceDelay")]
    public int DebounceDelay { get; set; }
    Property Value
    Type Description
    int

    int value. Default is 300.

    Destroyed

    Callback when the DropDownList is destroyed/disposed.

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

    Use for code cleanup or reporting unmount/teardown.

    EnableRtl

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

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

    true enables RTL. Default is false.

    EnableVirtualization

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

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

    true enables partial-view fetch; false disables.

    Remarks

    Highly recommended for lists exceeding 1000 items.

    Enabled

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

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

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

    FilterBarPlaceholder

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

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

    String specifying search placeholder. null for no placeholder.

    FilterType

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

    Declaration
    [JsonPropertyName("filterType")]
    [Parameter]
    public FilterType FilterType { get; set; }
    Property Value
    Type Description
    FilterType

    A FilterType enum value.

    Filtering

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

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

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

    FloatLabelType

    Controls floating label UI behavior for placeholder text.

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

    Never, Always, or Auto. Default: Never.

    Focus

    Callback when the DropDownList receives focus.

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

    Useful for accessibility, keyboard navigation, or showing hints.

    FooterTemplate

    Template for customizing the popup footer content.

    Declaration
    [JsonPropertyName("footerTemplate")]
    public RenderFragment FooterTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment

    Set as a RenderFragment.

    HeaderTemplate

    Template for customizing the popup header content.

    Declaration
    [JsonPropertyName("headerTemplate")]
    public RenderFragment HeaderTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment

    Set as a RenderFragment.

    HtmlAttributes

    Additional input HTML attributes set on the DropDownList root element.

    Declaration
    [JsonPropertyName("htmlAttributes")]
    public object HtmlAttributes { get; set; }
    Property Value
    Type Description
    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
    [JsonPropertyName("ignoreAccent")]
    [Parameter]
    public bool IgnoreAccent { get; set; }
    Property Value
    Type Description
    bool

    true to ignore; false to match on accents.

    IgnoreCase

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

    Declaration
    [JsonPropertyName("ignoreCase")]
    [Parameter]
    public bool IgnoreCase { get; set; }
    Property Value
    Type Description
    bool

    true for case-insensitive; false to match case.

    Index

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

    Declaration
    [JsonPropertyName("index")]
    public int Index { get; set; }
    Property Value
    Type Description
    int

    Integer with the zero-based selected index.

    Open

    Callback when the popup opens on this DropDownList.

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

    Use for analytics or asynchronous UI preparations.

    Placeholder

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

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

    Hint or placeholder string.

    Remarks

    Displayed based on FloatLabelType setting.

    PopupDisplayMode

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

    Declaration
    [JsonPropertyName("popupDisplayMode")]
    [JsonConverter(typeof(JsonStringEnumConverter))]
    public PopupDisplayMode PopupDisplayMode { get; set; }
    Property Value
    Type Description
    PopupDisplayMode

    A PopupDisplayMode value (default: FullScreen).

    PopupHeight

    Height of the suggestion popup (default: auto).

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

    Accepts any CSS length unit or auto.

    PopupWidth

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

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

    Accepts any CSS length unit.

    Query

    External query object used for customizing remote data and filtering.

    Declaration
    [JsonPropertyName("query")]
    [Parameter]
    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
    [JsonPropertyName("readonly")]
    public bool Readonly { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonIgnore]
    [JsonPropertyName("select")]
    public EventCallback<object> Select { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    EventCallback<object> for item selection events.

    ShowClearButton

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

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

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

    Text

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

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

    Current selection’s display text.

    Value

    Value of the currently selected item.

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

    ValueTemplate

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

    Declaration
    [JsonPropertyName("valueTemplate")]
    public RenderFragment<TValue> ValueTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment<TValue>

    Set as a RenderFragment<TValue>.

    Width

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

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

    Width string or null for auto.

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