menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class AutoCompleteModel - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class AutoCompleteModel

    Represents the model for the AutoComplete component, providing configuration properties and event hooks for remote data fetching, popup interactions, filtering, and UI behavior.

    Inheritance
    System.Object
    AutoCompleteModel
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class AutoCompleteModel : Object
    Remarks

    This class supports data binding, event handling, and customization of the AutoComplete control. Use its members to handle events and control AutoComplete's runtime behavior.

    Examples

    Example usage:

    <SfAutoComplete TValue="string" DataSource="@(new List<string>{ "One", "Two" })" Placeholder="Select a value">
        <AutoCompleteEvents TValue="string" TItem="string" OnChange="OnChangeHandler"></AutoCompleteEvents>
    </SfAutoComplete>

    Constructors

    AutoCompleteModel()

    Declaration
    public AutoCompleteModel()

    Properties

    ActionBegin

    Gets or sets event data when remote data fetching is initiated for the AutoComplete component.

    Declaration
    public ActionBeginEventArgs ActionBegin { get; set; }
    Property Value
    Type Description
    ActionBeginEventArgs

    An ActionBeginEventArgs instance containing event data for data fetch initiation.

    Remarks

    This event allows you to intervene or modify the query before data fetch begins.

    Examples

    See ActionBeginEventArgs for details on usage.

    ActionComplete

    Gets or sets event data for when remote data fetching is complete.

    Declaration
    public ActionCompleteEventArgs ActionComplete { get; set; }
    Property Value
    Type Description
    ActionCompleteEventArgs

    An ActionCompleteEventArgs instance containing event data for completion.

    Remarks

    Fires after successful data fetch from remote source.

    Examples

    See ActionCompleteEventArgs for details on usage.

    ActionFailure

    Gets or sets an event callback that is triggered when the data fetch request from the remote server fails.

    Declaration
    public EventCallback<object> ActionFailure { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> representing the callback for errors.

    Remarks

    This callback runs if the remote data request fails.

    Examples
    @code {
        void OnFailure(object args) {}
    }

    AllowCustom

    Gets or sets a value that determines whether the component allows the user to enter custom values not present in the data source.

    Declaration
    public bool AllowCustom { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if user-defined values are allowed; otherwise, false.

    Remarks

    Enable this setting to allow arbitrary user input in addition to list items.

    Examples

    Set to true to let users type new values.

    Autofill

    Gets or sets whether to suggest the first matched item in the input when searching; ignored if no match.

    Declaration
    public bool Autofill { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to enable auto-suggestion; otherwise, false.

    Remarks

    Improves usability for keyboard-oriented users.

    Examples

    Set Autofill to true for instant entry prediction.

    BeforeOpen

    Gets or sets event data before the popup opens.

    Declaration
    public BeforeOpenEventArgs BeforeOpen { get; set; }
    Property Value
    Type Description
    BeforeOpenEventArgs

    An BeforeOpenEventArgs instance raised before popup shows.

    Remarks

    Allows cancelling popup display based on runtime conditions.

    Examples

    See BeforeOpenEventArgs for usage.

    Blur

    Gets or sets a callback event that is triggered when focus moves out from the component.

    Declaration
    public EventCallback<object> Blur { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> fired when focus leaves.

    Remarks

    Use to detect blur events for validation or UI cleanup.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    Change

    Gets or sets an event that triggers when an item is selected or model value changes by user interaction.

    Declaration
    public EventCallback<object> Change { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> callback for value changes.

    Remarks

    Use this event to configure cascading behaviors or custom logic upon selection change.

    Examples
    @code {
        void OnChange(object args) {}
    }

    Close

    Gets or sets a callback event that is triggered when the popup is closed.

    Declaration
    public EventCallback<object> Close { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> when popup closes.

    Remarks

    Handle UI cleanup or notification logic after popup closes.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback for usage details.

    Created

    Gets or sets a callback event triggered when the AutoComplete component is created.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> called on component creation.

    Remarks

    This event is useful for triggering actions once AutoComplete initializes.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    CustomValueSpecifier

    Gets or sets a callback that triggers when a custom value is set.

    Declaration
    public EventCallback<object> CustomValueSpecifier { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> for custom value scenarios.

    Remarks

    Utilize for scenarios where user types a value not present in the list.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    DataBound

    Gets or sets the arguments raised when data bound to the AutoComplete completes.

    Declaration
    public DataBoundEventArgs DataBound { get; set; }
    Property Value
    Type Description
    DataBoundEventArgs

    A DataBoundEventArgs instance raised on data binding complete.

    Remarks

    Use this to track completion of binding data to UI.

    Examples

    See DataBoundEventArgs for usage.

    DebounceDelay

    Gets or sets the number of milliseconds to wait before performing filtering after user input, if filtering is enabled.

    Declaration
    public int DebounceDelay { get; set; }
    Property Value
    Type Description
    System.Int32

    The wait duration as int; default is 300 ms.

    Remarks

    This affects responsiveness when AllowFiltering is true.

    Examples

    Set DebounceDelay to control network throttling.

    Destroyed

    Gets or sets a callback triggered when the component is destroyed.

    Declaration
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> activated on component dispose.

    Remarks

    Use this for cleanup or analytics purposes at component unload.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    EnableVirtualization

    Gets or sets a value indicating whether virtual scrolling is enabled for performance in large data sets.

    Declaration
    public bool EnableVirtualization { get; set; }
    Property Value
    Type Description
    System.Boolean

    true enables virtualization; otherwise, false.

    Remarks

    Use for scenarios with significant data volumes for better performance. The Virtual Scrolling feature allows fetching data in chunks.

    Examples

    Set EnableVirtualization to true to enable chunked loading.

    Filtering

    Gets or sets a callback event triggered on every character typed in the component.

    Declaration
    public EventCallback<object> Filtering { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> for keyboard input.

    Remarks

    Use to trigger custom filtering logic on typing.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    FilterType

    Gets or sets the search filter type for matching suggestions.

    Declaration
    public FilterType FilterType { get; set; }
    Property Value
    Type Description
    FilterType

    The FilterType used for search.

    Remarks

    Controls whether the search uses prefix, substring, or other matching logic.

    Examples

    Choose FilterType.StartsWith for prefix search.

    Focus

    Gets or sets a callback triggered when the component is focused.

    Declaration
    public EventCallback<object> Focus { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> when focused.

    Remarks

    Use for highlighting UI or custom logic on focus.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    Highlight

    Gets or sets a value determining whether to highlight searched characters in suggestions.

    Declaration
    public bool Highlight { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to highlight search chars; otherwise, false.

    Remarks

    Highlights matching substrings for quicker visual recognition.

    Examples

    With Highlight enabled, search matches appear emphasized.

    MinLength

    Gets or sets the minimum number of characters required before search action is performed.

    Declaration
    public int MinLength { get; set; }
    Property Value
    Type Description
    System.Int32

    Minimum characters (int); default is 1.

    Remarks

    Search will not trigger until the minimum is met.

    Examples

    Set MinLength to increase required input for performance.

    Open

    Gets or sets a callback triggered when the popup opens.

    Declaration
    public EventCallback<object> Open { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> fired when popup displays.

    Remarks

    Used for showing hints or logging analytics when popup opens.

    Examples

    See Microsoft.AspNetCore.Components.EventCallback.

    Select

    Gets or sets an event triggered when an item in the popup is selected by the user either with mouse, tap, or keyboard navigation.

    Declaration
    public EventCallback<object> Select { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An EventCallback<object> for item selection.

    Remarks

    Use to detect and act upon actual selection events in the dropdown.

    Examples
    @code {
        void OnSelect(object args) {}
    }

    ShowClearButton

    Gets or sets whether the clear button appears, letting users quickly clear input.

    Declaration
    public bool ShowClearButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    true for clear button visible; otherwise, false.

    Remarks

    Clicking the clear button resets the Value, Text, and Index properties.

    Examples

    Toggle ShowClearButton to enhance usability.

    ShowPopupButton

    Gets or sets whether the popup button is shown within the AutoComplete component.

    Declaration
    public bool ShowPopupButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to show, false to hide the button.

    Remarks

    Show a dropdown icon for accessibility and visibility.

    Examples

    Set ShowPopupButton if visually indicating dropdown is desired.

    SuggestionCount

    Gets or sets the maximum number of items to display in the suggestion popup.

    Declaration
    public int SuggestionCount { get; set; }
    Property Value
    Type Description
    System.Int32

    Maximum count (int); default is 20.

    Remarks

    This setting controls the vertical size of the dropdown list, limiting visible results and improving usability with large lists.

    Examples

    Set SuggestionCount to limit or expand popup size as needed.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved