Table of Contents

Class RadzenDropDown<TValue>

Namespace
Radzen.Blazor
Assembly
Radzen.Blazor.dll

RadzenDropDown component.

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

Type Parameters

TValue

The type of the value.

Inheritance
DropDownBase<TValue>
RadzenDropDown<TValue>
Implements
Inherited Members

Examples

<RadzenDropDown @bind-Value=@customerID TValue="string" Data=@customers TextProperty="CompanyName" ValueProperty="CustomerID" Change=@(args => Console.WriteLine($"Selected CustomerID: {args}")) />

Constructors

RadzenDropDown()

public RadzenDropDown()

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.

[Parameter]
public bool Chips { get; set; }

Property Value

bool

true to display the selected items as chips; otherwise, false.

ClearSearchAfterSelection

Gets or sets a value indicating whether search field need to be cleared after selection. Set to false by default.

[Parameter]
public bool ClearSearchAfterSelection { get; set; }

Property Value

bool

true if need to be cleared; otherwise, false.

EmptyTemplate

Gets or sets the empty template.

[Parameter]
public RenderFragment EmptyTemplate { get; set; }

Property Value

RenderFragment

The empty template.

FilterPlaceholder

Gets or sets the filter placeholder.

[Parameter]
public string FilterPlaceholder { get; set; }

Property Value

string

The filter placeholder.

InputAttributes

Specifies additional custom attributes that will be rendered by the input.

[Parameter]
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }

Property Value

IReadOnlyDictionary<string, object>

The attributes.

ItemRender

Gets or sets the row render callback. Use it to set row attributes.

[Parameter]
public Action<DropDownItemRenderEventArgs<TValue>> ItemRender { get; set; }

Property Value

Action<DropDownItemRenderEventArgs<TValue>>

The row render callback.

MaxSelectedLabels

Gets or sets the number of maximum selected labels.

[Parameter]
public int MaxSelectedLabels { get; set; }

Property Value

int

The number of maximum selected labels.

OpenOnFocus

Gets or sets a value indicating whether popup should open on focus. Set to false by default.

[Parameter]
public bool OpenOnFocus { get; set; }

Property Value

bool

true if popup should open on focus; otherwise, false.

PopupStyle

Gets or sets the Popup height.

[Parameter]
public string PopupStyle { get; set; }

Property Value

string

The number Popup height.

ReadOnly

Gets or sets a value indicating whether is read only.

[Parameter]
public bool ReadOnly { get; set; }

Property Value

bool

true if is read only; otherwise, false.

SelectAllText

Gets or sets the select all text.

[Parameter]
public string SelectAllText { get; set; }

Property Value

string

The select all text.

SelectedItemsText

Gets or sets the selected items text.

[Parameter]
public string SelectedItemsText { get; set; }

Property Value

string

The selected items text.

ValueTemplate

Gets or sets the value template.

[Parameter]
public RenderFragment<dynamic> ValueTemplate { get; set; }

Property Value

RenderFragment<dynamic>

The value template.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

public override void Dispose()

GetComponentCssClass()

protected override string GetComponentCssClass()

Returns

string

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnSelectItem(object, bool)

Called when item is selected.

protected override Task OnSelectItem(object item, bool isFromKey = false)

Parameters

item object

The item.

isFromKey bool

if set to true [is from key].

Returns

Task

OpenPopup(string, bool, bool)

Opens the popup.

protected override Task OpenPopup(string key = "ArrowDown", bool isFilter = false, bool isFromClick = false)

Parameters

key string

The key.

isFilter bool

if set to true [is filter].

isFromClick bool

if set to true [is from click].

Returns

Task

SelectAll()

protected override Task SelectAll()

Returns

Task

SetParametersAsync(ParameterView)

public override Task SetParametersAsync(ParameterView parameters)

Parameters

parameters ParameterView

Returns

Task