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