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>, IDisposable, IRadzenFormComponent
Type Parameters
Name | Description |
---|---|
T |
Fields
list
The list
Declaration
protected ElementReference? list
Field Value
Type | Description |
---|---|
System.Nullable<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 |
---|---|
System.Int32 |
selectedItem
The selected item
Declaration
protected object selectedItem
Field Value
Type | Description |
---|---|
System.Object |
selectedItems
The selected items
Declaration
protected ISet<object> selectedItems
Field Value
Type | Description |
---|---|
ISet<System.Object> |
Properties
AllowClear
Gets or sets a value indicating whether the user can clear the value. Set to false
by default.
Declaration
public bool AllowClear { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowFiltering
Gets or sets a value indicating whether filtering is allowed. Set to false
by default.
Declaration
public virtual bool AllowFiltering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowSelectAll
Gets or sets a value indicating whether the user can select all values in multiple selection. Set to true
by default.
Declaration
public bool AllowSelectAll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowVirtualization
Specifies wether virtualization is enabled. Set to false
by default.
Declaration
public bool AllowVirtualization { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Count
Specifies the total number of items in the data source.
Declaration
public int Count { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Data
Gets or sets the data.
Declaration
public override IEnumerable Data { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable | The data. |
Overrides
DisabledProperty
Gets or sets the disabled property.
Declaration
public string DisabledProperty { get; set; }
Property Value
Type | Description |
---|---|
System.String | The disabled property. |
EmptyAriaLabel
Gets or sets the empty value aria label text.
Declaration
public string EmptyAriaLabel { get; set; }
Property Value
Type | Description |
---|---|
System.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
public virtual bool FilterAsYouType { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
FilterDelay
Gets or sets the filter delay.
Declaration
public int FilterDelay { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The filter delay. |
HasValue
Gets a value indicating whether this instance has value.
Declaration
public override bool HasValue { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
HeaderTemplate
Gets or sets the header template.
Declaration
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
public IEqualityComparer<object> ItemComparer { get; set; }
Property Value
Type | Description |
---|---|
IEqualityComparer<System.Object> |
Items
Gets the items.
Declaration
protected virtual IEnumerable<object> Items { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.Object> | The items. |
Multiple
Gets or sets a value indicating whether this DropDownBase<T> is multiple.
Declaration
public bool Multiple { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
PageSize
Specifies the default page size. Set to 5
by default.
Declaration
public int PageSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PopupID
Gets the popup identifier.
Declaration
protected string PopupID { get; }
Property Value
Type | Description |
---|---|
System.String | The popup identifier. |
RemoveChipTitle
Gets or sets the remove chip button title.
Declaration
public string RemoveChipTitle { get; set; }
Property Value
Type | Description |
---|---|
System.String | The remove chip button title. |
SearchAriaLabel
Gets or sets the search aria label text.
Declaration
public string SearchAriaLabel { get; set; }
Property Value
Type | Description |
---|---|
System.String | The search aria label text. |
SearchID
Gets the search identifier.
Declaration
public string SearchID { get; }
Property Value
Type | Description |
---|---|
System.String | The search identifier. |
SelectedItem
Gets or sets the selected item.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The selected item. |
SelectedItemChanged
Gets or sets the selected item changed.
Declaration
public EventCallback<object> SelectedItemChanged { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<System.Object> | The selected item changed. |
Separator
Gets or sets the item separator for Multiple dropdown.
Declaration
public string Separator { get; set; }
Property Value
Type | Description |
---|---|
System.String | Item separator |
Template
Gets or sets the template.
Declaration
public RenderFragment<dynamic> Template { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<System.Object> | The template. |
ValueProperty
Gets or sets the value property.
Declaration
public string ValueProperty { get; set; }
Property Value
Type | Description |
---|---|
System.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
public int VirtualizationOverscanCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Virtualize
The Virtualize instance.
Declaration
public Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<object> Virtualize { get; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<System.Object> |
Methods
ClearAll()
Clears all.
Declaration
protected async System.Threading.Tasks.Task ClearAll()
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Object | item | The item. |
System.String | property | The property. |
Returns
Type | Description |
---|---|
System.Object | System.Object. |
GetValue()
Gets the value.
Declaration
public override object GetValue()
Returns
Type | Description |
---|---|
System.Object | System.Object. |
Overrides
HandleKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs, Boolean, Nullable<Boolean>)
Handles the key press.
Declaration
protected virtual async System.Threading.Tasks.Task HandleKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args, bool isFilter = false, bool? shouldSelectOnChange = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.KeyboardEventArgs | args | The |
System.Boolean | isFilter | if set to |
System.Nullable<System.Boolean> | shouldSelectOnChange | Should select item on item change with keyboard. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnAfterRenderAsync(Boolean)
Called when [after render asynchronous].
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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 |
OnDataChanged()
Called when [data changed].
Declaration
protected override async Task OnDataChanged()
Returns
Type | Description |
---|---|
Task |
Overrides
OnFilter(ChangeEventArgs)
Handles the Filter event.
Declaration
protected virtual async System.Threading.Tasks.Task OnFilter(ChangeEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ChangeEventArgs | args | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnFilterKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs)
Handles the FilterKeyPress event.
Declaration
protected virtual async System.Threading.Tasks.Task OnFilterKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.KeyboardEventArgs | args | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnInitialized()
Called by the Blazor runtime.
Declaration
protected override void OnInitialized()
Overrides
OnKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs, Nullable<Boolean>)
Handles the KeyPress event.
Declaration
protected virtual async System.Threading.Tasks.Task OnKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args, bool? shouldSelectOnChange = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.KeyboardEventArgs | args | The |
System.Nullable<System.Boolean> | shouldSelectOnChange | Should select item on item change with keyboard. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnParametersSet()
Declaration
protected override void OnParametersSet()
OnParametersSetAsync()
Called when [parameters set asynchronous].
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
Task | Task. |
OnSelectItem(Object, Boolean)
Called when [select item].
Declaration
protected virtual async System.Threading.Tasks.Task OnSelectItem(object item, bool isFromKey = false)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item. |
System.Boolean | isFromKey | if set to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OpenPopup(String, Boolean, Boolean)
Opens the popup.
Declaration
protected virtual async System.Threading.Tasks.Task OpenPopup(string key = "ArrowDown", bool isFilter = false, bool isFromClick = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Boolean | isFilter | if set to |
System.Boolean | isFromClick | if set to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OpenPopupScript()
Opens the popup script.
Declaration
protected string OpenPopupScript()
Returns
Type | Description |
---|---|
System.String | System.String. |
OpenPopupScriptFromParent()
Opens the popup script from parent.
Declaration
protected string OpenPopupScriptFromParent()
Returns
Type | Description |
---|---|
System.String | System.String. |
Reset()
Resets this instance.
Declaration
public void Reset()
SelectAll()
Selects all.
Declaration
protected virtual async System.Threading.Tasks.Task SelectAll()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SelectItem(Object, Boolean)
Selects the item.
Declaration
public async System.Threading.Tasks.Task SelectItem(object item, bool raiseChange = true)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item. |
System.Boolean | raiseChange | if set to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SelectItemFromValue(Object)
Selects the item from value.
Declaration
protected virtual void SelectItemFromValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
SetParametersAsync(ParameterView)
Set parameters as an asynchronous operation.
Declaration
public override async Task SetParametersAsync(ParameterView parameters)
Parameters
Type | Name | Description |
---|---|---|
ParameterView | parameters | The parameters. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |