# DropDownBase<T> Class

Base class of components that display a list of items.

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

Assembly: Radzen.Blazor.dll

## Inheritance

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

## Implements

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

## Syntax

```csharp
public class DropDownBase<T> : DataBoundFormComponent<T>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent
```

## Type Parameters

| Name | Description |
|------|-------------|
| T |  |

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public DropDownBase<T>()` | Base class of components that display a list of items. |

## Fields

| Field | Type | Description |
|------|------|-------------|
| PreserveCollectionOnSelection | `bool` | Will add/remove selected items from a bound ICollection<T>, instead of replacing it. |
| isPopupOpen | `bool` | Gets a value indicating whether the popup is open. |
| list | `ElementReference?` | The list |
| search | `ElementReference` | The search |
| selectedIndex | `int` | The selected index |
| selectedItem | `object` | The selected item |
| selectedItems | `ISet<object>` | The selected items |

## Properties

| Property | Type | Description |
|------|------|-------------|
| AllowClear | `bool` | Gets or sets a value indicating whether the user can clear the value. Set to false by default. |
| AllowFiltering | `bool` | Gets or sets a value indicating whether filtering is allowed. Set to false by default. |
| AllowSelectAll | `bool` | Gets or sets a value indicating whether the user can select all values in multiple selection. Set to true by default. |
| AllowVirtualization | `bool` | Specifies wether virtualization is enabled. Set to false by default. |
| ClearAriaLabel | `string` | Gets or sets the clear button aria label text. |
| Count | `int` | Specifies the total number of items in the data source. |
| Data | `Collections.IEnumerable` | Gets or sets the data. |
| DisabledProperty | `string` | Gets or sets the disabled property. |
| EmptyAriaLabel | `string` | Gets or sets the empty value aria label text. |
| FilterAsYouType | `bool` | Gets or sets a value indicating whether filtering is allowed as you type. Set to true by default. |
| FilterDelay | `int` | Gets or sets the filter delay. |
| HasValue | `bool` |  |
| HeaderTemplate | `RenderFragment` | Gets or sets the header template. |
| ItemComparer | `IEqualityComparer<object>` | For lists of objects, an IEqualityComparer to control how selected items are determined |
| Items | `IEnumerable<object>` | Gets the items. |
| ListId | `string` | Gets the listbox identifier. |
| Multiple | `bool` | Gets or sets a value indicating whether this [DropDownBase<T>](https://blazor.radzen.com/docs/api/Radzen.DropDownBase-1.md) is multiple. |
| PageSize | `int` | Specifies the default page size. Set to 5 by default. |
| PopupID | `string` | Gets the popup identifier. |
| RemoveChipTitle | `string` | Gets or sets the remove chip button title. |
| ResetSelectedIndexOnFilter | `bool` | Gets or sets a value indicating the selected index should reset to the top item when filtering, resulting in a down arrow action will start moving from the top. |
| SearchAriaLabel | `string` | Gets or sets the search aria label text. |
| SearchID | `string` | Gets the search identifier. |
| SelectedItem | `object` | Gets or sets the selected item. |
| SelectedItemChanged | `EventCallback<object>` | Gets or sets the selected item changed. |
| Separator | `string` | Gets or sets the item separator for Multiple dropdown. |
| Template | `RenderFragment<object>` | Gets or sets the template. |
| ValueProperty | `string` | Gets or sets the value property. |
| View | `Collections.IEnumerable` | Gets the view. |
| VirtualizationOverscanCount | `int` | Gets or sets a value that determines how many additional items will be rendered before and after the visible region. This help to reduce the frequency of rendering during scrolling. However, higher values mean that more elements will be present in the page. |
| Virtualize | `Virtualization.Virtualize<object>` | The Virtualize instance. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `ClearAll()` | `Task` | Clears all. |
| `Dispose()` | `void` |  |
| `GetItemAriaLabel(object item)` | `string` | Gets the accessible name of an item. Returns null when no meaningful text can be derived, so the caller can omit the aria-label and let assistive technology use the rendered content. Parameters: `item`: The item. Returns: The accessible name or null. |
| `GetItemOrValueFromProperty(object item, string property)` | `object` | Gets the item or value from property. Parameters: `item`: The item. `property`: The property. Returns: System.Object. |
| `GetValue()` | `object` |  |
| `HandleKeyPress(KeyboardEventArgs args, bool isFilter, bool? shouldSelectOnChange)` | `Task` | Handles the key press. Parameters: `args`: The KeyboardEventArgs instance containing the event data. `isFilter`: if set to true [is filter]. `shouldSelectOnChange`: Should select item on item change with keyboard. |
| `OnAfterRenderAsync(bool firstRender)` | `Task` | Called when [after render asynchronous]. Parameters: `firstRender`: if set to true [first render]. Returns: Task. |
| `OnChange(ChangeEventArgs args)` | `void` | Handles the Change event. Parameters: `args`: The ChangeEventArgs instance containing the event data. |
| `OnDataChanged()` | `Task` |  |
| `OnFilter(ChangeEventArgs args)` | `Task` | Handles the FilterKeyPress event. Parameters: `args`: The KeyboardEventArgs instance containing the event data. |
| `OnFilterInput(ChangeEventArgs args)` | `Task` | Handles filter input changes (e.g. paste). Parameters: `args`: The ChangeEventArgs instance containing the event data. |
| `OnFilterKeyPress(KeyboardEventArgs args)` | `Task` | Handles the FilterKeyPress event. Parameters: `args`: The KeyboardEventArgs instance containing the event data. |
| `OnInitialized()` | `void` |  |
| `OnKeyPress(KeyboardEventArgs args, bool? shouldSelectOnChange)` | `Task` | Handles the KeyPress event. Parameters: `args`: The KeyboardEventArgs instance containing the event data. `shouldSelectOnChange`: Should select item on item change with keyboard. |
| `OnParametersSet()` | `void` |  |
| `OnParametersSetAsync()` | `Task` | Called when [parameters set asynchronous]. Returns: Task. |
| `OnSearchTextChanged()` | `Task` |  |
| `OnSelectAllKeyDown(KeyboardEventArgs args)` | `Task` | Handles keyboard activation for the select-all action. Parameters: `args`: The KeyboardEventArgs instance containing the event data. |
| `OnSelectItem(object item, bool isFromKey)` | `Task` | Called when [select item]. Parameters: `item`: The item. `isFromKey`: if set to true [is from key]. |
| `OpenPopup(string key, bool isFilter, bool isFromClick)` | `Task` | Opens the popup script. Returns: System.String. |
| `OpenPopupScript()` | `string` | Opens the popup script. Returns: System.String. |
| `OpenPopupScriptFromParent()` | `string` | Opens the popup script from parent. Returns: System.String. |
| `Reset()` | `void` | Resets this instance. |
| `SelectAll()` | `Task` | Selects all. |
| `SelectItem(object item, bool raiseChange)` | `Task` | Selects the item internal. Parameters: `item`: The item. `raiseChange`: if set to true [raise change]. |
| `SelectItemFromValue(object value)` | `void` | Selects the item from value. Parameters: `value`: The value. |
| `SetParametersAsync(ParameterView parameters)` | `Task` | Set parameters as an asynchronous operation. Parameters: `parameters`: The parameters. Returns: A Task representing the asynchronous operation. |
| `ShouldRender()` | `bool` |  |

## Inherited Members

- From [DataBoundFormComponent<T>](https://blazor.radzen.com/docs/api/Radzen.DataBoundFormComponent-1.md): Change, CurrentPlaceholder, Disabled, EditContext, FieldIdentifier, FilterCaseSensitivity, FilterOperator, FocusAsync, Form, FormFieldContext, GetClassList, IsBound, IsLoading, LoadData, LoadingTemplate, Name, NotifyFieldChanged, OnContextMenu, Placeholder, Query, SearchText, SearchTextChanged, 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, GetComponentCssClass, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnBecameInvisible, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, BuildRenderTree, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, RendererInfo, StateHasChanged

