Class RadzenDropDown<TValue>
RadzenDropDown component.
Inheritance
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenDropDown<TValue> : DropDownBase<TValue>, IDisposable, IRadzenFormComponent
Type Parameters
Name | Description |
---|---|
TValue | The type of the value. |
Examples
<RadzenDropDown @bind-Value=@customerID TValue="string" Data=@customers TextProperty="CompanyName" ValueProperty="CustomerID" Change=@(args => Console.WriteLine($"Selected CustomerID: {args}")) />
Properties
Chips
Gets or sets a value indicating whether the selected items will be displayed as chips. Set to false
by default.
Requires Multiple to be set to true
.
Declaration
public bool Chips { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ClearSearchAfterSelection
Gets or sets a value indicating whether search field need to be cleared after selection. Set to false
by default.
Declaration
public bool ClearSearchAfterSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Close
Callback for when a dropdown is closed.
Declaration
public EventCallback Close { get; set; }
Property Value
Type | Description |
---|---|
EventCallback |
EmptyTemplate
Gets or sets the empty template.
Declaration
public RenderFragment EmptyTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment | The empty template. |
FilterAutoCompleteType
Gets or Sets the filter autocomplete type.
Declaration
public AutoCompleteType FilterAutoCompleteType { get; set; }
Property Value
Type | Description |
---|---|
AutoCompleteType | The filter autocomplete type. Default: Off |
FilterPlaceholder
Gets or sets the filter placeholder.
Declaration
public string FilterPlaceholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | The filter placeholder. |
InputAttributes
Specifies additional custom attributes that will be rendered by the input.
Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.String, System.Object> | The attributes. |
ItemRender
Gets or sets the row render callback. Use it to set row attributes.
Declaration
public Action<DropDownItemRenderEventArgs<TValue>> ItemRender { get; set; }
Property Value
Type | Description |
---|---|
Action<DropDownItemRenderEventArgs<TValue>> | The row render callback. |
MaxSelectedLabels
Gets or sets the number of maximum selected labels.
Declaration
public int MaxSelectedLabels { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of maximum selected labels. |
Open
Callback for when a dropdown is opened.
Declaration
public EventCallback Open { get; set; }
Property Value
Type | Description |
---|---|
EventCallback |
OpenOnFocus
Gets or sets a value indicating whether popup should open on focus. Set to false
by default.
Declaration
public bool OpenOnFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
PopupStyle
Gets or sets the Popup height.
Declaration
public string PopupStyle { get; set; }
Property Value
Type | Description |
---|---|
System.String | The number Popup height. |
ReadOnly
Gets or sets a value indicating whether is read only.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SelectAllText
Gets or sets the select all text.
Declaration
public string SelectAllText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The select all text. |
SelectedItemsText
Gets or sets the selected items text.
Declaration
public string SelectedItemsText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The selected items text. |
ValueTemplate
Gets or sets the value template.
Declaration
public RenderFragment<dynamic> ValueTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<System.Object> | The value template. |
Methods
Dispose()
Disposes this instance.
Declaration
public override void Dispose()
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
Type | Description |
---|---|
System.String |
Overrides
OnAfterRenderAsync(Boolean)
Called when [after render asynchronous].
Declaration
protected override async Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | if set to |
Returns
Type | Description |
---|---|
Task | Task. |
Overrides
OnClose()
Called when popup is closed.
Declaration
public async Task OnClose()
Returns
Type | Description |
---|---|
Task |
OnSelectItem(Object, Boolean)
Called when item is selected.
Declaration
protected override async 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 |
---|---|
Task |
Overrides
OpenPopup(String, Boolean, Boolean)
Opens the popup.
Declaration
protected override async 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 |
---|---|
Task |
Overrides
SelectAll()
Selects all.
Declaration
protected override Task SelectAll()
Returns
Type | Description |
---|---|
Task |
Overrides
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. |