Class DropDownBase<T>
Base class of components that display a list of items.
Inheritance
Inherited Members
Namespace: Radzen
Assembly: Radzen.Blazor.dll
Syntax
public class DropDownBase<T> : DataBoundFormComponent<T>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
DropDownBase()
Base class of components that display a list of items.
Declaration
public DropDownBase()
Fields
PreserveCollectionOnSelection
Will add/remove selected items from a bound ICollection<T>, instead of replacing it.
Declaration
protected bool PreserveCollectionOnSelection
Field Value
| Type | Description |
|---|---|
| bool |
list
The list
Declaration
protected ElementReference? list
Field Value
| Type | Description |
|---|---|
| ElementReference? |
search
The search
Declaration
protected ElementReference search
Field Value
| Type | Description |
|---|---|
| ElementReference |
selectedIndex
The selected index
Declaration
protected int selectedIndex
Field Value
| Type | Description |
|---|---|
| int |
selectedItem
The selected item
Declaration
protected object selectedItem
Field Value
| Type | Description |
|---|---|
| object |
selectedItems
The selected items
Declaration
protected ISet<object> selectedItems
Field Value
| Type | Description |
|---|---|
| ISet<object> |
Properties
AllowClear
Gets or sets a value indicating whether the user can clear the value. Set to false by default.
Declaration
[Parameter]
public bool AllowClear { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
AllowFiltering
Gets or sets a value indicating whether filtering is allowed. Set to false by default.
Declaration
[Parameter]
public virtual bool AllowFiltering { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
AllowSelectAll
Gets or sets a value indicating whether the user can select all values in multiple selection. Set to true by default.
Declaration
[Parameter]
public bool AllowSelectAll { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
AllowVirtualization
Specifies wether virtualization is enabled. Set to false by default.
Declaration
[Parameter]
public bool AllowVirtualization { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Count
Specifies the total number of items in the data source.
Declaration
[Parameter]
public int Count { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Data
Gets or sets the data.
Declaration
[Parameter]
public override IEnumerable Data { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable | The data. |
Overrides
DisabledProperty
Gets or sets the disabled property.
Declaration
[Parameter]
public string DisabledProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The disabled property. |
EmptyAriaLabel
Gets or sets the empty value aria label text.
Declaration
[Parameter]
public string EmptyAriaLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The empty value aria label text. |
FilterAsYouType
Gets or sets a value indicating whether filtering is allowed as you type. Set to true by default.
Declaration
[Parameter]
public virtual bool FilterAsYouType { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
FilterDelay
Gets or sets the filter delay.
Declaration
[Parameter]
public int FilterDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The filter delay. |
HasValue
Gets a value indicating whether this instance has value.
Declaration
public override bool HasValue { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Overrides
HeaderTemplate
Gets or sets the header template.
Declaration
[Parameter]
public RenderFragment HeaderTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The header template. |
ItemComparer
For lists of objects, an IEqualityComparer to control how selected items are determined
Declaration
[Parameter]
public IEqualityComparer<object> ItemComparer { get; set; }
Property Value
| Type | Description |
|---|---|
| IEqualityComparer<object> |
Items
Gets the items.
Declaration
protected virtual IEnumerable<object> Items { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<object> | The items. |
Multiple
Gets or sets a value indicating whether this DropDownBase<T> is multiple.
Declaration
[Parameter]
public bool Multiple { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
PageSize
Specifies the default page size. Set to 5 by default.
Declaration
[Parameter]
public int PageSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
PopupID
Gets the popup identifier.
Declaration
protected string PopupID { get; }
Property Value
| Type | Description |
|---|---|
| string | The popup identifier. |
RemoveChipTitle
Gets or sets the remove chip button title.
Declaration
[Parameter]
public string RemoveChipTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The remove chip button title. |
ResetSelectedIndexOnFilter
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.
Declaration
[Parameter]
public bool ResetSelectedIndexOnFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
SearchAriaLabel
Gets or sets the search aria label text.
Declaration
[Parameter]
public string SearchAriaLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The search aria label text. |
SearchID
Gets the search identifier.
Declaration
public string SearchID { get; }
Property Value
| Type | Description |
|---|---|
| string | The search identifier. |
SelectedItem
Gets or sets the selected item.
Declaration
[Parameter]
public object SelectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| object | The selected item. |
SelectedItemChanged
Gets or sets the selected item changed.
Declaration
[Parameter]
public EventCallback<object> SelectedItemChanged { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<object> | The selected item changed. |
Separator
Gets or sets the item separator for Multiple dropdown.
Declaration
[Parameter]
public string Separator { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Item separator |
Template
Gets or sets the template.
Declaration
[Parameter]
public RenderFragment<dynamic> Template { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<dynamic> | The template. |
ValueProperty
Gets or sets the value property.
Declaration
[Parameter]
public string ValueProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The value property. |
View
Gets the view.
Declaration
protected override IEnumerable View { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable | The view. |
Overrides
VirtualizationOverscanCount
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.
Declaration
[Parameter]
public int VirtualizationOverscanCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Virtualize
The Virtualize instance.
Declaration
public Virtualize<object> Virtualize { get; }
Property Value
| Type | Description |
|---|---|
| Virtualize<object> |
Methods
ClearAll()
Clears all.
Declaration
protected Task ClearAll()
Returns
| Type | Description |
|---|---|
| Task |
Dispose()
Disposes this instance.
Declaration
public override void Dispose()
Overrides
GetItemOrValueFromProperty(object, string)
Gets the item or value from property.
Declaration
public object GetItemOrValueFromProperty(object item, string property)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The item. |
| string | property | The property. |
Returns
| Type | Description |
|---|---|
| object | System.Object. |
GetValue()
Gets the value.
Declaration
public override object GetValue()
Returns
| Type | Description |
|---|---|
| object | System.Object. |
Overrides
HandleKeyPress(KeyboardEventArgs, bool, bool?)
Handles the key press.
Declaration
protected virtual Task HandleKeyPress(KeyboardEventArgs args, bool isFilter = false, bool? shouldSelectOnChange = null)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyboardEventArgs | args | The KeyboardEventArgs instance containing the event data. |
| bool | isFilter | if set to |
| bool? | shouldSelectOnChange | Should select item on item change with keyboard. |
Returns
| Type | Description |
|---|---|
| Task |
OnAfterRenderAsync(bool)
Called when [after render asynchronous].
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | firstRender | if set to |
Returns
| Type | Description |
|---|---|
| Task | Task. |
Overrides
OnChange(ChangeEventArgs)
Handles the Change event.
Declaration
protected void OnChange(ChangeEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ChangeEventArgs | args | The ChangeEventArgs instance containing the event data. |
OnDataChanged()
Called when [data changed].
Declaration
protected override Task OnDataChanged()
Returns
| Type | Description |
|---|---|
| Task |
Overrides
OnFilter(ChangeEventArgs)
Handles the Filter event.
Declaration
protected virtual Task OnFilter(ChangeEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ChangeEventArgs | args | The ChangeEventArgs instance containing the event data. |
Returns
| Type | Description |
|---|---|
| Task |
OnFilterKeyPress(KeyboardEventArgs)
Handles the FilterKeyPress event.
Declaration
protected virtual Task OnFilterKeyPress(KeyboardEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyboardEventArgs | args | The KeyboardEventArgs instance containing the event data. |
Returns
| Type | Description |
|---|---|
| Task |
OnInitialized()
Called by the Blazor runtime.
Declaration
protected override void OnInitialized()
Overrides
OnKeyPress(KeyboardEventArgs, bool?)
Handles the KeyPress event.
Declaration
protected virtual Task OnKeyPress(KeyboardEventArgs args, bool? shouldSelectOnChange = null)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyboardEventArgs | args | The KeyboardEventArgs instance containing the event data. |
| bool? | shouldSelectOnChange | Should select item on item change with keyboard. |
Returns
| Type | Description |
|---|---|
| Task |
OnParametersSet()
Base class of components that display a list of items.
Declaration
protected override void OnParametersSet()
Overrides
OnParametersSetAsync()
Called when [parameters set asynchronous].
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type | Description |
|---|---|
| Task | Task. |
Overrides
OnSelectItem(object, bool)
Called when [select item].
Declaration
protected virtual Task OnSelectItem(object item, bool isFromKey = false)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The item. |
| bool | isFromKey | if set to |
Returns
| Type | Description |
|---|---|
| Task |
OpenPopup(string, bool, bool)
Opens the popup.
Declaration
protected virtual Task OpenPopup(string key = "ArrowDown", bool isFilter = false, bool isFromClick = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key. |
| bool | isFilter | if set to |
| bool | isFromClick | if set to |
Returns
| Type | Description |
|---|---|
| Task |
OpenPopupScript()
Opens the popup script.
Declaration
protected string OpenPopupScript()
Returns
| Type | Description |
|---|---|
| string | System.String. |
OpenPopupScriptFromParent()
Opens the popup script from parent.
Declaration
protected string OpenPopupScriptFromParent()
Returns
| Type | Description |
|---|---|
| string | System.String. |
Reset()
Resets this instance.
Declaration
public void Reset()
SelectAll()
Selects all.
Declaration
protected virtual Task SelectAll()
Returns
| Type | Description |
|---|---|
| Task |
SelectItem(object, bool)
Selects the item.
Declaration
public Task SelectItem(object item, bool raiseChange = true)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The item. |
| bool | raiseChange | if set to |
Returns
| Type | Description |
|---|---|
| Task |
SelectItemFromValue(object)
Selects the item from value.
Declaration
protected virtual void SelectItemFromValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value. |
SetParametersAsync(ParameterView)
Set parameters as an asynchronous operation.
Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters | The parameters. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |