# RadzenDropDown<TValue> Class

A dropdown select component that allows users to choose one or multiple items from a popup list. RadzenDropDown supports data binding, filtering, templates, virtual scrolling, and both single and multiple selection modes. Binds to a data source via the Data property and uses TextProperty and ValueProperty to determine what to display and what value to bind. Supports filtering (with configurable operators and case sensitivity), custom item templates, empty state templates, value templates for the selected item display, and can be configured as editable to allow custom text entry. For multiple selection, set Multiple=true and bind to a collection type.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- [DataBoundFormComponent<TValue>](https://blazor.radzen.com/docs/api/Radzen.DataBoundFormComponent-1.md)
- [DropDownBase<TValue>](https://blazor.radzen.com/docs/api/Radzen.DropDownBase-1.md)
- RadzenDropDown<TValue>

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IRadzenFormComponent](https://blazor.radzen.com/docs/api/Radzen.IRadzenFormComponent.md)

## Syntax

```csharp
public class RadzenDropDown<TValue> : DropDownBase<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent
```

## Type Parameters

| Name | Description |
|------|-------------|
| TValue | The type of the selected value. Can be a primitive type, complex object, or collection for multiple selection. |

## Examples

Basic dropdown with data binding:

```razor
<RadzenDropDown @bind-Value=@customerID TValue="string" Data=@customers TextProperty="CompanyName" ValueProperty="CustomerID" />
```

Dropdown with filtering and placeholder:

```razor
<RadzenDropDown @bind-Value=@selectedId TValue="int" Data=@items TextProperty="Name" ValueProperty="Id" 
                 AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" Placeholder="Select an item..." />
```

Multiple selection dropdown:

```razor
<RadzenDropDown @bind-Value=@selectedIds TValue="IEnumerable<int>" Data=@items Multiple="true" Chips="true" />
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenDropDown<TValue>()` | A dropdown select component that allows users to choose one or multiple items from a popup list. RadzenDropDown supports data binding, filtering, templates, virtual scrolling, and both single and multiple selection modes. Binds to a data source via the Data property and uses TextProperty and ValueProperty to determine what to display and what value to bind. Supports filtering (with configurable operators and case sensitivity), custom item templates, empty state templates, value templates for the selected item display, and can be configured as editable to allow custom text entry. For multiple selection, set Multiple=true and bind to a collection type. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| Chips | `bool` | Gets or sets whether selected items should be displayed as removable chips in the input area. When enabled in multiple selection mode, each selected item appears as a chip with an X button for quick removal. Requires Multiple to be set to true. |
| ClearSearchAfterSelection | `bool` | Gets or sets whether the filter search text should be cleared after an item is selected. When true, selecting an item will reset the filter, showing all items again on the next open. |
| Close | `EventCallback` | Callback for when a dropdown is closed. |
| EmptyTemplate | `RenderFragment` | Gets or sets the template displayed when the dropdown data source is empty or no items match the filter. Use this to show a custom "No items found" or "Empty list" message. |
| FilterAutoCompleteType | [`AutoCompleteType`](https://blazor.radzen.com/docs/api/Radzen.Blazor.AutoCompleteType.md) | Gets or sets the HTML autocomplete attribute value for the filter search input. Controls whether the browser should provide autocomplete suggestions for the filter field. |
| FilterPlaceholder | `string` | Gets or sets the placeholder text displayed in the filter search box within the dropdown popup. This helps users understand they can filter the list by typing. |
| FooterTemplate | `RenderFragment` | Gets or sets the footer template. |
| InputAttributes | `IReadOnlyDictionary<string, object>` | Gets or sets additional HTML attributes to be applied to the underlying input element. This allows passing custom attributes like data-* attributes, aria-* attributes, or other HTML attributes directly to the input. |
| InputSize | [`InputSize`](https://blazor.radzen.com/docs/api/Radzen.InputSize.md) | Gets or sets the size of the component. |
| ItemRender | `Action<DropDownItemRenderEventArgs<TValue>>` | Gets or sets a callback invoked when rendering each dropdown item. Use this to customize item attributes, such as adding CSS classes or data attributes based on item properties. |
| MaxSelectedLabels | `int` | Gets or sets the maximum number of selected item labels to display in the input before showing a count summary. When multiple selection is enabled and more items are selected than this value, the input will show "N items selected" instead of listing all labels. Only applicable when Multiple is true. |
| Open | `EventCallback` | Callback for when a dropdown is opened. |
| OpenOnFocus | `bool` | Gets or sets whether the dropdown popup should automatically open when the input receives focus. Useful for improving user experience by reducing clicks needed to interact with the dropdown. |
| OpenPopupKey | `string` | Gets or sets the keyboard key that triggers opening the popup when OpenOnFocus is enabled. Default is "Enter". |
| PopupStyle | `string` | Gets or sets the CSS style applied to the dropdown popup container. Use this to control the popup dimensions, especially max-height to limit scrollable area. |
| ReadOnly | `bool` | Gets or sets whether the dropdown is read-only and cannot be changed by user interaction. When true, the dropdown displays the selected value but prevents changing the selection. |
| SelectAllText | `string` | Gets or sets the select all text. |
| SelectedItemsText | `string` | Gets or sets the selected items text. |
| ShowValueTemplateOnEmpty | `bool` | Gets or sets whether ValueTemplate is rendered even when there is no selected item. When true, the template is invoked with a null context so it can render an editor (e.g. a text box) for an empty value. Templates must handle a null context. |
| ValueTemplate | `RenderFragment<object>` | Gets or sets the template used to render the currently selected value in the dropdown input. This allows custom formatting or layout for the displayed selection. The template receives the selected item as context. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `ClosePopup()` | `Task` | Closes the dropdown popup programmatically. |
| `Dispose()` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `HandleKeyPress(KeyboardEventArgs args, bool isFilter, bool? shouldSelectOnChange)` | `Task` |  |
| `OnAfterRenderAsync(bool firstRender)` | `Task` |  |
| `OnClose()` | `Task` | Called when popup is closed. |
| `OnSelectItem(object item, bool isFromKey)` | `Task` | Called when item is selected. Parameters: `item`: The item. `isFromKey`: if set to true [is from key]. |
| `OpenPopup()` | `Task` | Opens the dropdown popup programmatically. |
| `OpenPopup(string key, bool isFilter, bool isFromClick)` | `Task` | Opens the dropdown popup programmatically. |
| `SelectAll()` | `Task` |  |
| `SetParametersAsync(ParameterView parameters)` | `Task` |  |
| `TogglePopup()` | `Task` | Toggles the dropdown popup, opening it if it is closed and closing it if it is open. |

## Inherited Members

- From [DropDownBase<TValue>](https://blazor.radzen.com/docs/api/Radzen.DropDownBase-1.md): AllowClear, AllowFiltering, AllowSelectAll, AllowVirtualization, ClearAll, ClearAriaLabel, Count, Data, DisabledProperty, EmptyAriaLabel, FilterAsYouType, FilterDelay, GetItemAriaLabel, GetItemOrValueFromProperty, GetValue, HasValue, HeaderTemplate, ItemComparer, Items, ListId, Multiple, OnChange, OnDataChanged, OnFilter, OnFilterInput, OnFilterKeyPress, OnInitialized, OnKeyPress, OnParametersSet, OnParametersSetAsync, OnSearchTextChanged, OnSelectAllKeyDown, OpenPopupScript, OpenPopupScriptFromParent, PageSize, PopupID, PreserveCollectionOnSelection, RemoveChipTitle, Reset, ResetSelectedIndexOnFilter, SearchAriaLabel, SearchID, SelectItem, SelectItemFromValue, SelectedItem, SelectedItemChanged, Separator, ShouldRender, Template, ValueProperty, View, VirtualizationOverscanCount, Virtualize, isPopupOpen, list, search, selectedIndex, selectedItem, selectedItems
- From [DataBoundFormComponent<TValue>](https://blazor.radzen.com/docs/api/Radzen.DataBoundFormComponent-1.md): Change, CurrentPlaceholder, Disabled, EditContext, FieldIdentifier, FilterCaseSensitivity, FilterOperator, FocusAsync, Form, FormFieldContext, FormFieldLabelledBy, GetClassList, IsBound, IsLoading, LabelTargetId, LabelToLink, LinkLabelAsync, LoadData, LoadingTemplate, Name, NotifyFieldChanged, OnContextMenu, Placeholder, Query, SearchText, SearchTextChanged, ShouldLinkLabel, TabIndex, TextProperty, Value, ValueChanged, ValueExpression, _view
- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnBecameInvisible, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, RendererInfo, StateHasChanged

