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>.NotifyFieldChanged

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>.IsLoading

DataBoundFormComponent<string>.LoadingTemplate

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.Localize

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.UICulture

RadzenComponent.DefaultUICulture

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 to this section

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 to this section

Gets list element reference.

Declaration
protected ElementReference list

Properties

EmptyTemplateLink to this section

Gets or sets the empty template shown when there are no suggestions to display.

Declaration
public RenderFragment EmptyTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the empty template shown when there are no suggestions to display.

FilterDelayLink to this section

Gets or sets the filter delay.

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

InputAttributesLink to this section

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.

InputSizeLink to this section

Gets or sets the size of the component.

Declaration
public InputSize InputSize { get; set; }
Property Value
Type Description
InputSizeGets or sets the size of the component.

InputTypeLink to this section

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 to this section

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 to this section

Gets or sets the minimum length.

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

MultilineLink to this section

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 to this section

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 to this section

Gets or sets the Popup height.

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

QueryLink to this section

Gets the IQueryable.

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

SelectedItemLink to this section

Gets or sets the selected item.

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

SelectedItemChangedLink to this section

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 to this section

Gets or sets the template.

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

ViewLink to this section

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 to this section

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

DisposeLink to this section

Declaration
public override void Dispose()

FocusAsyncLink to this section

Sets the focus on the input element.

Declaration
public override ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClassLink to this section

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnAfterRenderAsyncLink to this section

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.

OnFilterKeyPressLink to this section

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

OnPopupCloseLink to this section

Invoked from client-side code when the suggestion popup closes.

Declaration
public Task OnPopupClose()
Returns
Type Description
Task

OnPopupOpenLink to this section

Invoked from client-side code when the suggestion popup opens.

Declaration
public Task OnPopupOpen()
Returns
Type Description
Task

SetParametersAsyncLink to this section

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task

SetValueLink to this section

Handles the @bind:set binding of the underlying input element.

Declaration
protected Task SetValue(string value)
Parameters
Type Name Description
string value The new value reported by the change event.
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙