alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    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
    object
    AutoCompleteModel
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class AutoCompleteModel
    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
    [JsonPropertyName("actionBegin")]
    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
    [JsonPropertyName("actionComplete")]
    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
    [JsonIgnore]
    [JsonPropertyName("actionFailure")]
    public EventCallback<object> ActionFailure { get; set; }
    Property Value
    Type Description
    EventCallback<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
    [JsonPropertyName("allowCustom")]
    public bool AllowCustom { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("autofill")]
    public bool Autofill { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("beforeOpen")]
    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
    [JsonIgnore]
    [JsonPropertyName("blur")]
    public EventCallback<object> Blur { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> fired when focus leaves.

    Remarks

    Use to detect blur events for validation or UI cleanup.

    Examples

    See EventCallback.

    Change

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("change")]
    public EventCallback<object> Change { get; set; }
    Property Value
    Type Description
    EventCallback<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
    [JsonIgnore]
    [JsonPropertyName("close")]
    public EventCallback<object> Close { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> when popup closes.

    Remarks

    Handle UI cleanup or notification logic after popup closes.

    Examples

    See EventCallback for usage details.

    Created

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("created")]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> called on component creation.

    Remarks

    This event is useful for triggering actions once AutoComplete initializes.

    Examples

    See EventCallback.

    CustomValueSpecifier

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("customValueSpecifier")]
    public EventCallback<object> CustomValueSpecifier { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> for custom value scenarios.

    Remarks

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

    Examples

    See EventCallback.

    DataBound

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

    Declaration
    [JsonPropertyName("dataBound")]
    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
    [JsonPropertyName("debounceDelay")]
    public int DebounceDelay { get; set; }
    Property Value
    Type Description
    int

    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
    [JsonIgnore]
    [JsonPropertyName("destroyed")]
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> activated on component dispose.

    Remarks

    Use this for cleanup or analytics purposes at component unload.

    Examples

    See EventCallback.

    EnableVirtualization

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

    Declaration
    [JsonPropertyName("enableVirtualization")]
    public bool EnableVirtualization { get; set; }
    Property Value
    Type Description
    bool

    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.

    FilterType

    Gets or sets the search filter type for matching suggestions.

    Declaration
    [JsonPropertyName("filterType")]
    [JsonConverter(typeof(JsonStringEnumConverter))]
    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.

    Filtering

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("filtering")]
    public EventCallback<object> Filtering { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> for keyboard input.

    Remarks

    Use to trigger custom filtering logic on typing.

    Examples

    See EventCallback.

    Focus

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

    Declaration
    [JsonIgnore]
    [JsonPropertyName("focus")]
    public EventCallback<object> Focus { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> when focused.

    Remarks

    Use for highlighting UI or custom logic on focus.

    Examples

    See EventCallback.

    Highlight

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

    Declaration
    [JsonPropertyName("highlight")]
    public bool Highlight { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("minLength")]
    public int MinLength { get; set; }
    Property Value
    Type Description
    int

    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
    [JsonIgnore]
    [JsonPropertyName("open")]
    public EventCallback<object> Open { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<object> fired when popup displays.

    Remarks

    Used for showing hints or logging analytics when popup opens.

    Examples

    See 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
    [JsonIgnore]
    [JsonPropertyName("select")]
    public EventCallback<object> Select { get; set; }
    Property Value
    Type Description
    EventCallback<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
    [JsonPropertyName("showClearButton")]
    public bool ShowClearButton { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("showPopupButton")]
    public bool ShowPopupButton { get; set; }
    Property Value
    Type Description
    bool

    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
    [JsonPropertyName("suggestionCount")]
    public int SuggestionCount { get; set; }
    Property Value
    Type Description
    int

    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.

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