Hello,
I'm on version 20.2.0.40. The DataBound event not being triggered for the SfAutoComplete component.
Any ideas or workarounds?
In case it matters, this is how it is configured:
<SfAutoComplete @ref="DestinationsDropDown"
TValue="string"
TItem="BaseItemViewModel"
Placeholder="Select a Destination"
DataSource="@DestinationsList"
Autofill=true
@bind-Value="@CurrentDestination"
Query="@LocalDataQuery"
PopupHeight="130px" EnableVirtualization="true" ShowPopupButton="true">
<AutoCompleteFieldSettings Value="Name" />
<AutoCompleteEvents TItem="BaseItemViewModel" TValue="string"
ValueChange="DestinationsDropDownValueChanged"
Created="DestinationsDropDownCreated"
DataBound="DestinationsDropDownDataBound">
</AutoCompleteEvents>
</SfAutoComplete>
Thanks!
More info: I'm just trying to use the "Created" and "DataBound" events to call "ShowSpinnerAsync()" and
"HideSpinnerAsync()". Is there a better way to accomplish this?
Hi horacioj,
We suggest you use the OnActionComplete event instead of the DataBound event for your requirement. The OnActionComplete will be triggered in the below-mentioned scenarios.
Also, we can call the HideSpinnerAsync and ShowSpinnerAsync using component ref as like in the below code snippet.
@page "/" @using Syncfusion.Blazor.DropDowns @using Syncfusion.Blazor.Data
<label>Local Data</label> <SfAutoComplete TItem="GameFields" TValue="string" DataSource="@Games" PopupHeight="130px" EnableVirtualization="true" ShowPopupButton="true" Placeholder="Select a Destination" @ref="DestinationsDropDown" Autofill=true> <AutoCompleteEvents TItem="GameFields" TValue="string" OnActionComplete="@OnActionCompleteHandler" Created="@CreatedHandler"></AutoCompleteEvents> <AutoCompleteFieldSettings Text="Text" Value="ID"></AutoCompleteFieldSettings> </SfAutoComplete>
@code { SfAutoComplete<string, GameFields> DestinationsDropDown;
private async Task OnActionCompleteHandler() { DestinationsDropDown.HideSpinnerAsync(); }
private async Task CreatedHandler(Object args) { DestinationsDropDown.ShowSpinnerAsync(); } } |
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorServerApp2141336152
Regards,
Udhaya Kumar D
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.
Thank you, Udhaya. It works.
Out of curiosity, shouldn't the DataBound event be working too? Actually, I saw it never being triggered.
Hi horacioj,
We are validating the requirement. We will update the further details in two business days (10th August 2022).
Regards,
Udhaya Kumar D
Hi horacioj,
We will deprecate the DataBound event for the SfAutoComplete component. So, we suggest using the OnActionComplete event instead of the DataBound event for your requirements. As mentioned earlier, the OnActionComplete event is also triggered in the following cases.
Regards,
Udhaya Kumar D
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.