DropDownList Blazor API
NameTypeDefaultDescription
AutoCloseDelayint100Used only when dropDownOpenMode is set to 'auto'. Determines the delay before the opened drop down closes if the pointer is not over the element.
DataSourceobjectN/ADetermines the data source that will be loaded to the DropDownList. The dataSource can be an array of strings/numbers or objects where the attributes represent the properties of a List Item. For example label, value, group. It can also be a callback that returns an Array of items as previously described.
DisabledboolfalseEnables or disables the element.
DisplayLoadingIndicatorboolfalseDetermines whether an indicator will appear during filtering and remote item loading.
DisplayMemberstring""Sets or gets the displayMember. The displayMember specifies the name of an object property to display. The name is contained in the collection specified by the 'dataSource' property.
DropDownAppendTostring"null"Determines the drop down parent. The expected value is CSS Selector, ID or 'body'. The drop down can be removed from the body of the element and continue to work in another container. This is usefull when one of the parents of the element doesn't allow overflowing, by settings this property to 'body' the drop down will be appended to the DOM and the popup will open/close as usual. dropDownAppendTo can be a string representing the id of an HTML element on the page or a direct reference to that element. Reseting it back to null will take the drop down back to it's original place.
DropDownButtonPositionDropDownButtonPositionDropDownButtonPosition.RightDetermines the position of the drop down button.
DropDownHeightobjectSets the height of the drop down. By default it's set to an empty string. In this case the height of the drop down is controlled by a CSS variable.
DropDownMaxHeightobjectSets the maximum Height of the drop down. By default it's set to an empty string. In this case the maxHeight of the drop down is controlled by a CSS variable.
DropDownMaxWidthobjectSets the maximum Width of the drop down. By default it's set to an empty string. In this case the maxWidth of the drop down is controlled by a CSS variable.
DropDownMinHeightobjectSets the minimum Height of the drop down. By default it's set to an empty string. In this case the minHeight of the drop down is controlled by a CSS variable.
DropDownMinWidthobjectSets the minimum Width of the drop down. By default it's set to an empty string. In this case the minWidth of the drop down is controlled by a CSS variable.
DropDownOpenModeDropDownOpenModeDropDownOpenMode.DefaultDetermines how the drop down is going to open.
DropDownOverlayboolfalseIf this property is enabled, when the element's dropdown is opened, a transparent overlay is positioned between the dropdown and the rest of the document. The purpose of the overlay is to make sure that clicking anywhere outside the popup will will target the overlay and not the DOM.
DropDownPlaceholderstring"No Items"Determines the placeholder for the drop down list when it's empty.
DropDownPositionDropDownPositionDropDownPosition.AutoDetermines the position of the drop down when opened.
DropDownWidthobjectSets the width of the drop down. By default it's set to an empty string. In this case the width of the drop down is controlled by a CSS variable.
FilterableboolfalseDetermines whether filtering is enabled.
FilterInputPlaceholderstring""Determines the placeholder for the filter input inside the drop down that is only visible when filterable is enabled.
FilterModeFilterModeFilterMode.StartsWithIgnoreCaseDetermines the filtering mode of the drop down list.
GroupedboolfalseIf enabled, the items will be grouped by their first letter. Can't be applied if the dataSource already contains groups.
GroupMemberstring"null"Determines which attribute from the dataSource object will be used as the group member for the items. If not set, by default 'group' property is used from the source object. groupMember is especially usefull when loading the data from a JSON file as a dataSource for the ListBox and there's a specific property that should be used to group the items.
Hintstring""Sets additional helper text below the element. The hint is visible only when the element is focused.
HorizontalScrollBarVisibilityHorizontalScrollBarVisibilityHorizontalScrollBarVisibility.AutoDetermines the visibility of the horizontal Scroll bar inside the drop down.
InputMemberstring""Represents the property name of a List item. Determines the value of the input when a ListItem is selected. Usefull in cases where the user wants to display for example the value of an item instead of it's label. By default the label is displayed in the input.
IncrementalSearchDelayint700IncrementalSearchDelay property specifies the time-interval in milliseconds until the previous search query is cleared. The timer starts when the user stops typing. A new query can be started only when the delay has passed.
IncrementalSearchModeSearchModeSearchMode.StartsWithIgnoreCaseSets ot gets the mode of the incremental search mode. Incremental search is enabled by default. Typing while the drop down is focused starts the incremental search.
ItemHeightint?N/ASets the height for all list items. Used only when virtualization is enabled.
ItemMeasureModeListItemMeasureModeListItemMeasureMode.AutoDetermines the item width measuring algorithm.
ItemsIEnumerable<object>A getter that returns an array of all List items inside the drop down.
ItemTemplateobjectN/AThe itemTemplate property is a string that represents the id of an HTMLTemplateElement in the DOM or it's direct reference. It's used to set a customize the content of the list items.
Labelstring""Sets a little text label above the element.
LoadingIndicatorPlaceholderstring"Loading..."Determines the text that will be displayed next to the loading indicator when the loader is visible and it's position is top or bottom.
LoadingIndicatorPositionVerticalAlignmentVerticalAlignment.CenterDetermines the position of the loading indicator.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
Namestring""Sets or gets the name attribute for the element. Name is used when submiting HTML forms.
IsOpenedboolfalseDetermines whether the popup is opened or not.
Placeholderstring""Determines the element's placeholder, displayed in the element's selection field.
ReadonlyboolfalseDisables user interaction with the element.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
ResizeIndicatorboolfalseDetermines whether the resize indicator in the bottom right corner of the drop down is visible or not. This property is used in conjunction with resizeMode.
ResizeModeResizeModeResizeMode.NoneDetermines whether the dropDown can be resized or not. When resizing is enabled, a resize bar appears on the top/bottom side of the drop down.
SelectionDisplayModeSelectionDisplayModeSelectionDisplayMode.PlainDetermines what will be displayed in the dropDown selection field.
SelectedIndexesint[]new int[]{}Sets or gets the selected indexes. Selected indexes represents an array of the indexes of the items that should be selected.
SelectedValuesstring[]new string[]{}Sets or gets elected indexes. Selected values represents the values of the items that should be selected.
SelectionModeListSelectionModeListSelectionMode.ZeroAndOneDetermines how many items can be selected.
SortedboolfalseDetermines whether the items are sorted alphabetically or not
SortDirectionstring"asc"Determines sorting direction - ascending(asc) or descending(desc)
Themestring""Determines the theme for the element. Themes define the look of the elements.
TokenTemplateobjectN/ASets a custom template for the content of the tokens when selectionDisplayMode is set to 'tokens'.
UnfocusableboolfalseIf is set to true, the element cannot be focused.
ValueobjectN/ASets or gets the value. Returns the selection. Return type: {label: string, value: any}[].
ValueMemberstring""Determines the value member of an item. Stored as value in the item object. Similar to groupMember, valueMember is especially usefull when using data from a JSON file as a dataSource for the ListBox and there's a specific property that should be used for the value the items.
VerticalScrollBarVisibilityVerticalScrollBarVisibilityVerticalScrollBarVisibility.AutoDetermines the visibility of the vertical scroll bar.
VirtualizedboolfalseDetermines weather or not Virtualization is used. Virtualization allows a huge amount of items to be loaded to the drop down while preserving the performance. For example a milion items can be loaded.
NameTypeArgumentsDescription
AppendChilddynamicdynamic nodeAppends a ListItem to the end of the list of items inside element.Args: dynamic node - A ListItem element that should be added to the rest of the items as the last item.
ClearItemsvoidN/ARemoves all items from the drop down list.
ClearSelectionvoidN/AUnselects all items.
ClosevoidN/ACloses the dropDown list.
EnsureVisiblevoidobject itemEnsures the desired item is visible by scrolling to it.Args: object item - A list item or value of the desired item to be visible.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetIsOpenedAsync()Task<bool>'N/A'Gets the &quot;IsOpened&quot; property as Task&lt;bool&gt;.
GetItemobjectstring valueReturns an item instance from the dropDown list.Args: string value - The value of an item from the drop down list.
GetSelectedIndexesAsync()Task<int[]>'N/A'Gets the &quot;SelectedIndexes&quot; property as Task&lt;int[]&gt;.
GetSelectedValuesAsync()Task<string[]>'N/A'Gets the &quot;SelectedValues&quot; property as Task&lt;string[]&gt;.
GetValueAsync()Task<object>'N/A'Gets the &quot;Value&quot; property as Task&lt;object&gt;.
Insertvoidint position, object valueInserts a new item at a specified position.Args: int position - The position where the item must be inserted.,object value - The value of the new item.
InsertBeforedynamicdynamic node, dynamic referenceNodeInserts a new ListItem before another in the list.Args: dynamic node - A ListItem element that should be added before the referenceItem in the list.,dynamic referenceNode - A ListItem element that acts as the reference item before which a new item is about to be inserted. The referenceNode must be in the same list as the node.
OpenvoidN/AOpens the dropDown list.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RemoveAtvoidint positionRemoves an item at a specified position.Args: int position - The position of the removed item.
RemoveChilddynamicdynamic nodeRemoves a ListItem from the list of items inside element.Args: dynamic node - A ListItem element that is part of the list of items inside the element.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
Selectvoidstring itemSelects an item from the dropDown list. Args: string item - A string, representing the value of the item or an HTML Element referencing an item from the list
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
Unselectvoidstring itemUnselects an item from the dropDown list. Args: string item - A string, representing the value of the item or an HTML Element referencing an item from the list
Updatevoidint position, object valueUpdates an item from the dropDown list.Args: int position - The position where the item must be updated.,object value - The value of the updated item.
NameTypeDescriptionEvent Detail
OnActionButtonClickEventCallback<Event>This event is triggered when user clicks on the action button. The action button is only visible when dropDownOpenMode is set to 'dropDownbutton'.N/A
ActionButtonClickedevent DropDownListActionButtonClickedEventHandlerThis event is triggered when user clicks on the action button. The action button is only visible when dropDownOpenMode is set to 'dropDownbutton'.DropDownListActionButtonClickedEventArgs
OnChangeEventCallback<Event>This event is triggered when the selection is changed.dynamic addedItems- An array of List items that have been selected., dynamic disabled- A flag indicating whether or not the item that caused the change event is disabled., int index- The index of the List item that triggered the event., string label- The label of the List item that triggered the event., dynamic removedItems- An array of List items that have been unselected before the event was fired., dynamic selected- The selected state of the List item that triggered the event. If an item was selected the value will be true and vice versa., dynamic value- The value of the List item that triggered the event.
Changedevent DropDownListChangedEventHandlerThis event is triggered when the selection is changed.DropDownListChangedEventArgs
OnCloseEventCallback<Event>This event is triggered when the drop down list is closed.N/A
Closedevent DropDownListClosedEventHandlerThis event is triggered when the drop down list is closed.DropDownListClosedEventArgs
OnClosingEventCallback<Event>This event is triggered when the drop down list is about to be closed. This event allows to cancel the closing operation calling event.preventDefault() in the event handler function.N/A
Closingevent DropDownListClosingEventHandlerThis event is triggered when the drop down list is about to be closed. This event allows to cancel the closing operation calling event.preventDefault() in the event handler function.DropDownListClosingEventArgs
OnDropDownButtonClickEventCallback<Event>This event is triggered when user clicks on the drop down button.N/A
DropDownButtonClickedevent DropDownListDropDownButtonClickedEventHandlerThis event is triggered when user clicks on the drop down button.DropDownListDropDownButtonClickedEventArgs
OnItemClickEventCallback<Event>This event is triggered when an item is clicked.dynamic disabled- Indicates whether the List item that was clicked is disabled or not., int index- Indicates the index of the List item that was clicked., string label- The label of the List item that was clicked., dynamic selected- Indicates whether the List item that was clicked is selected or not., dynamic value- The value of the List item that was clicked.
ItemClickedevent DropDownListItemClickedEventHandlerThis event is triggered when an item is clicked.DropDownListItemClickedEventArgs
OnOpenEventCallback<Event>This event is triggered when the drop down list is opened.N/A
Openedevent DropDownListOpenedEventHandlerThis event is triggered when the drop down list is opened.DropDownListOpenedEventArgs
OnOpeningEventCallback<Event>This event is triggered when the drop down list is about to be opened. This event allows to cancel the opening operation calling event.preventDefault() in the event handler function.N/A
Openingevent DropDownListOpeningEventHandlerThis event is triggered when the drop down list is about to be opened. This event allows to cancel the opening operation calling event.preventDefault() in the event handler function.DropDownListOpeningEventArgs
OnResizeStartEventCallback<Event>This event is triggered when user starts resizing the drop down.dynamic position- An object containing the current left and top positions of the drop down.
ResizeStartedevent DropDownListResizeStartedEventHandlerThis event is triggered when user starts resizing the drop down.DropDownListResizeStartedEventArgs
OnResizeEndEventCallback<Event>This event is triggered when the resizing of the drop down is finished.dynamic position- An object containing the current left and top positions of the drop down.
ResizeEndedevent DropDownListResizeEndedEventHandlerThis event is triggered when the resizing of the drop down is finished.DropDownListResizeEndedEventArgs
OnScrollBottomReachedEventCallback<Event>This event is triggered when the user scrolls to the end of the dropDown list.N/A
ScrollBottomReachedevent DropDownListScrollBottomReachedEventHandlerThis event is triggered when the user scrolls to the end of the dropDown list.DropDownListScrollBottomReachedEventArgs
OnScrollTopReachedEventCallback<Event>This event is triggered when the user scrolls to the start of the dropDown list.N/A
ScrollTopReachedevent DropDownListScrollTopReachedEventHandlerThis event is triggered when the user scrolls to the start of the dropDown list.DropDownListScrollTopReachedEventArgs
DropDownButtonPosition.Left
DropDownButtonPosition.Right
DropDownButtonPosition.Top
DropDownButtonPosition.Bottom
DropDownOpenMode.None
DropDownOpenMode.Default
DropDownOpenMode.DropDownButton
DropDownOpenMode.Auto
DropDownPosition.Auto
DropDownPosition.Top
DropDownPosition.Bottom
DropDownPosition.OverlayTop
DropDownPosition.OverlayCenter
DropDownPosition.OverlayBottom
DropDownPosition.CenterBottom
DropDownPosition.CenterTop

FilterMode

FilterMode.Contains
FilterMode.ContainsIgnoreCase
FilterMode.Custom
FilterMode.DoesNotContain
FilterMode.DoesNotContainIgnoreCase
FilterMode.Equals
FilterMode.EqualsIgnoreCase
FilterMode.StartsWith
FilterMode.StartsWithIgnoreCase
FilterMode.EndsWith
FilterMode.EndsWithIgnoreCase

HorizontalScrollBarVisibility

HorizontalScrollBarVisibility.Auto
HorizontalScrollBarVisibility.Disabled
HorizontalScrollBarVisibility.Hidden
HorizontalScrollBarVisibility.Visible

SearchMode

SearchMode.Contains
SearchMode.ContainsIgnoreCase
SearchMode.DoesNotContain
SearchMode.DoesNotContainIgnoreCase
SearchMode.Equals
SearchMode.EqualsIgnoreCase
SearchMode.StartsWith
SearchMode.StartsWithIgnoreCase
SearchMode.EndsWith
SearchMode.EndsWithIgnoreCase

ListItemMeasureMode

ListItemMeasureMode.Auto
ListItemMeasureMode.Precise

VerticalAlignment

VerticalAlignment.Bottom
VerticalAlignment.Center
VerticalAlignment.Top

ResizeMode

ResizeMode.None
ResizeMode.Horizontal
ResizeMode.Vertical
ResizeMode.Both

SelectionDisplayMode

SelectionDisplayMode.Plain
SelectionDisplayMode.Placeholder
SelectionDisplayMode.Tokens

ListSelectionMode

ListSelectionMode.None
ListSelectionMode.OneOrManyExtended
ListSelectionMode.ZeroOrMany
ListSelectionMode.OneOrMany
ListSelectionMode.ZeroAndOne
ListSelectionMode.ZeroOrOne
ListSelectionMode.One
ListSelectionMode.CheckBox
ListSelectionMode.RadioButton

VerticalScrollBarVisibility

VerticalScrollBarVisibility.Auto
VerticalScrollBarVisibility.Disabled
VerticalScrollBarVisibility.Hidden
VerticalScrollBarVisibility.Visible