RadzenAutoComplete Class

An autocomplete text input component that provides real-time suggestions as users type based on a data source. RadzenAutoComplete combines a text input with a suggestion dropdown that filters and displays matching items, enabling quick selection without typing complete values. Features configurable filter operators (Contains, StartsWith, etc.) and case sensitivity, binding to any IEnumerable data source with TextProperty to specify display field, MinLength to require typing before showing suggestions, FilterDelay for debouncing, custom templates for rendering suggestion items, LoadData event for on-demand server-side filtering, textarea-style multiline input support, and option to show all items when field gains focus. Unlike dropdown, allows free-text entry and suggests matching items. The Value is the entered text, while SelectedItem provides access to the selected data object.

Inheritance

Object

ComponentBase

RadzenComponent

DataBoundFormComponent<string>

RadzenAutoComplete

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

DataBoundFormComponent<string>.OnDataChanged

DataBoundFormComponent<string>.GetValue

DataBoundFormComponent<string>.GetClassList

DataBoundFormComponent<string>.OnContextMenu

DataBoundFormComponent<string>.TabIndex

DataBoundFormComponent<string>.FilterCaseSensitivity

DataBoundFormComponent<string>.FilterOperator

DataBoundFormComponent<string>.Name

DataBoundFormComponent<string>.Placeholder

DataBoundFormComponent<string>.Disabled

DataBoundFormComponent<string>.Change

DataBoundFormComponent<string>.LoadData

DataBoundFormComponent<string>.Form

DataBoundFormComponent<string>.Value

DataBoundFormComponent<string>.ValueChanged

DataBoundFormComponent<string>.IsBound

DataBoundFormComponent<string>.HasValue

DataBoundFormComponent<string>.TextProperty

DataBoundFormComponent<string>.Data

DataBoundFormComponent<string>.SearchText

DataBoundFormComponent<string>.SearchTextChanged

DataBoundFormComponent<string>.EditContext

DataBoundFormComponent<string>.FieldIdentifier

DataBoundFormComponent<string>.ValueExpression

DataBoundFormComponent<string>.FormFieldContext

DataBoundFormComponent<string>.CurrentPlaceholder

DataBoundFormComponent<string>._view

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenAutoComplete : DataBoundFormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Examples

Basic autocomplete:

<RadzenAutoComplete @bind-Value=@customerName Data=@customers TextProperty="CompanyName" />

Autocomplete with custom filtering and delay:

<RadzenAutoComplete @bind-Value=@search Data=@products TextProperty="ProductName"
                     FilterOperator="StringFilterOperator.Contains" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
                     MinLength="2" FilterDelay="300" Placeholder="Type to search products..." />

Constructors

RadzenAutoCompletelink

An autocomplete text input component that provides real-time suggestions as users type based on a data source. RadzenAutoComplete combines a text input with a suggestion dropdown that filters and displays matching items, enabling quick selection without typing complete values. Features configurable filter operators (Contains, StartsWith, etc.) and case sensitivity, binding to any IEnumerable data source with TextProperty to specify display field, MinLength to require typing before showing suggestions, FilterDelay for debouncing, custom templates for rendering suggestion items, LoadData event for on-demand server-side filtering, textarea-style multiline input support, and option to show all items when field gains focus. Unlike dropdown, allows free-text entry and suggests matching items. The Value is the entered text, while SelectedItem provides access to the selected data object.

Declaration
public RadzenAutoComplete()

Fields

listlink

Gets list element reference.

Declaration
protected ElementReference list

Properties

FilterDelaylink

Gets or sets the filter delay.

Declaration
public int FilterDelay { get; set; }
Property Value
Type Description
intGets or sets the filter delay.

InputAttributeslink

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

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Specifies additional custom attributes that will be rendered by the input.

InputTypelink

Gets or sets the underlying input type. This does not apply when Multiline is true.

Declaration
public string InputType { get; set; }
Property Value
Type Description
stringGets or sets the underlying input type. This does not apply when Multiline is true.

MaxLengthlink

Gets or sets the underlying max length.

Declaration
public long? MaxLength { get; set; }
Property Value
Type Description
long?Gets or sets the underlying max length.

MinLengthlink

Gets or sets the minimum length.

Declaration
public int MinLength { get; set; }
Property Value
Type Description
intGets or sets the minimum length.

Multilinelink

Gets or sets a value indicating whether this RadzenAutoComplete is multiline.

Declaration
public bool Multiline { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenAutoComplete is multiline.

OpenOnFocuslink

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
boolGets or sets a value indicating whether popup should open on focus. Set to false by default.

PopupStylelink

Gets or sets the Popup height.

Declaration
public string PopupStyle { get; set; }
Property Value
Type Description
stringGets or sets the Popup height.

Querylink

Gets the IQueryable.

Declaration
protected IQueryable Query { get; }
Property Value
Type Description
IQueryableGets the IQueryable.

SelectedItemlink

Gets or sets the selected item.

Declaration
public object SelectedItem { get; set; }
Property Value
Type Description
objectGets or sets the selected item.

SelectedItemChangedlink

Gets or sets the selected item changed.

Declaration
public EventCallback<object> SelectedItemChanged { get; set; }
Property Value
Type Description
EventCallback<object>Gets or sets the selected item changed.

Templatelink

Gets or sets the template.

Declaration
public RenderFragment<object> Template { get; set; }
Property Value
Type Description
RenderFragment<object>Gets or sets the template.

Viewlink

Gets the view - the Query with filtering applied.

Declaration
protected Collections.IEnumerable View { get; }
Property Value
Type Description
Collections.IEnumerableGets the view - the Query with filtering applied.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

Disposelink

Declaration
public override void Dispose()

FocusAsynclink

Sets the focus on the input element.

Declaration
public override ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnAfterRenderAsynclink

Called on after render asynchronous.

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type Name Description
bool firstRender if set to true is first render.
Returns
Type Description
TaskTask.

OnChangelink

Handles the Change event.

Declaration
protected Task OnChange(ChangeEventArgs args)
Parameters
Type Name Description
ChangeEventArgs args The ChangeEventArgs instance containing the event data.
Returns
Type Description
Task

OnFilterKeyPresslink

Handles the FilterKeyPress event.

Declaration
protected Task OnFilterKeyPress(KeyboardEventArgs args)
Parameters
Type Name Description
KeyboardEventArgs args The KeyboardEventArgs instance containing the event data.
Returns
Type Description
Task

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙