Class AutoCompleteEvents<TValue, TItem>
Represents the event handlers for a AutoComplete component in the Blazor framework.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class AutoCompleteEvents<TValue, TItem> : OwningComponentBase
Type Parameters
Name | Description |
---|---|
TValue | The type of value associated with the AutoComplete. |
TItem | The type of item associated with the AutoComplete. |
Constructors
AutoCompleteEvents()
Declaration
public AutoCompleteEvents()
Properties
Blur
Gets or sets the event callback that will be invoked when the AutoComplete component loses focus.
Declaration
public EventCallback<object> Blur { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
Closed
Gets or sets the event callback that will be invoked after the suggestions popup has been closed.
Declaration
public EventCallback<ClosedEventArgs> Closed { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ClosedEventArgs> |
Created
Gets or sets the event callback that will be invoked when the component is created.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
CustomValueSpecifier
Gets or sets the event callback for the custom value specifier event of the AutoComplete.
Declaration
public EventCallback<CustomValueSpecifierEventArgs<TItem>> CustomValueSpecifier { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<CustomValueSpecifierEventArgs<TItem>> |
DataBound
Gets or sets the event callback that will be invoked when the data source is populated in the suggestion list.
Declaration
public EventCallback<DataBoundEventArgs> DataBound { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<DataBoundEventArgs> |
Destroyed
Gets or sets the event callback that will be invoked when the component is destroyed.
Declaration
public EventCallback<object> Destroyed { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
Filtering
Gets or sets the event callback that will be invoked on typing a character in the AutoComplete.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> |
Remarks
Prevent the default filter action and make your query enable the PreventDefaultAction event argument, and pass the modified data source and query in the FilterAsync(IEnumerable<TItem>, Query, FieldSettingsModel) method.
Examples
<SfAutoComplete @ref="AutoCompleteObj" TItem="string" TValue="string" AllowFiltering="true" DataSource="@MyList">
<AutoCompleteEvents TValue="string" TItem="string" Filtering="@OnFilteringHandler" />
</SfAutoComplete>
@code{
SfAutoComplete<string, string> AutoCompleteObj { get; set; }
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public async Task OnFilteringHandler(FilteringEventArgs args) {
args.PreventDefaultAction = true;
var query = new Query().Where(new WhereFilter() { Field = "Text", Operator = "contains", value = args.Text, IgnoreCase = true });
await AutoCompleteObj.FilterAsync(MyList, query);
}
}
Focus
Gets or sets the event callback that will be invoked when the component is the focus.
Declaration
public EventCallback<object> Focus { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
OnActionBegin
Gets or sets the event callback that will be invoked before fetching data from the data source.
Declaration
public EventCallback<ActionBeginEventArgs> OnActionBegin { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ActionBeginEventArgs> |
OnActionComplete
Gets or sets the evnet callback that will be invoked after data is fetched sucaction from the data source.
Declaration
public EventCallback<ActionCompleteEventArgs<TItem>> OnActionComplete { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ActionCompleteEventArgs<TItem>> |
OnActionFailure
Gets or sets the event callback that will be invoked when the data fetch request fails.
Declaration
public EventCallback<Exception> OnActionFailure { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Exception> |
OnClose
Gets or sets the event callback that will be invoked before the suggestions popup is closed.
Declaration
public EventCallback<PopupEventArgs> OnClose { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> |
Remarks
Prevent the suggestions popup close action using Cancel and the popup remains opened always.
Examples
<SfAutoComplete TItem="string" TValue="string" DataSource="@MyList">
<AutoCompleteEvents TValue="string" TItem="string" OnClose="@OnCloseHandler"/>
</SfAutoComplete>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnCloseHandler(PopupEventArgs args) {
args.Cancel = true;
}
}
OnOpen
Gets or sets the event callback that will be invoked when the suggestions popup before it opens
Declaration
public EventCallback<BeforeOpenEventArgs> OnOpen { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<BeforeOpenEventArgs> |
Remarks
Prevent the suggestions popup open action using Cancel.
Examples
<SfAutoComplete TItem="string" TValue="string" DataSource="@MyList">
<AutoCompleteEvents TValue="string" TItem="string" OnOpen="@OnOpenHandler"/>
</SfAutoComplete>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnOpenHandler(BeforeOpenEventArgs args) {
args.Cancel = true;
}
}
OnValueSelect
Gets or sets the event callback that will be invoked when an item is selected from the suggestions popup by the user either with a mouse tap or with a keyboard navigation.
Declaration
public EventCallback<SelectEventArgs<TItem>> OnValueSelect { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<SelectEventArgs<TItem>> |
Remarks
Prevent the item selection action using Cancel.
Examples
<SfAutoComplete TItem="string" TValue="string" DataSource="@MyList">
<AutoCompleteEvents TValue="string" TItem="string" OnValueSelect="@OnSelectHandler" />
</SfAutoComplete>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnSelectHandler(SelectEventArgs<string> args) {
if(args.ItemData== "Medium")
args.Cancel = true;
}
}
Opened
Gets or sets the event callback that will be invoked when the suggestions popup opens.
Declaration
public EventCallback<PopupEventArgs> Opened { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> |
ValueChange
Gets or sets the event callback that will be invoked when the Value property changed.
Declaration
public EventCallback<ChangeEventArgs<TValue, TItem>> ValueChange { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ChangeEventArgs<TValue, TItem>> |
Remarks
This event triggers when an item in a popup is selected or when the user changes the model value.
Examples
<SfAutoComplete TItem="string" TValue="string" DataSource="@MyList">
<AutoCompleteEvents TValue="string" TItem="string" ValueChange="@OnChange"/>
</SfAutoComplete>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, string> args) {
var NewValue = args.Value;
}
}
Methods
ComponentDispose(Boolean)
Declaration
protected void ComponentDispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |