I am using an AutoComplete inside a DataGrid like this:
<SfGrid DataSource="@Actions" @ref="ActionsGrid" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">
<GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(ActionRow.Id) HeaderText="ID" Width="120" Visible="false"></GridColumn>
<GridColumn Field=@nameof(ActionRow.DisplayName) HeaderText="Team" Width="150">
<EditTemplate>
<SfAutoComplete TItem="Group" TValue="string" ID="Id" @bind-value="@((context as ActionRow).Team.DisplayName)">
<SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>
<AutoCompleteFieldSettings Value="DisplayName"></AutoCompleteFieldSettings>
</SfAutoComplete>
</EditTemplate>
</GridColumn>
</GridColumns>
</SfGrid>
Inside the Custom DataManager I have the following. I am calling _apiService which is an injected data access service.
public override async Task<object> ReadAsync(DataManagerRequest dm, string key = null)
{
IEnumerable<Group> DataSource = new List<Group>();
if (dm.Where != null && dm.Where.Count > 0) //Filtering
{
var search = (string) dm.Where[0].value;
DataSource = await _apiService.GetData(search);
}
Console.WriteLine("Queried...");
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = DataSource.Count() } : (object)DataSource;
}
However, when I enter edit mode for a row I see the ReadAsync call is called multiple times and the dropdown that is presented contains duplicates of the data.
If i type 1 character in the autocomplete ReadAsync is called twice. I have two rows in the grid so could that be related?
I would expect for 1 character that ReadAsync is called once and the dropdown only contains one set of the results.
Hi Chris,
Greetings from Syncfusion support.
We are validating the reported problem from our side. We will update you further details within two business days. Until then we appreciate your patience.
Regards,
Renjith R
I noticed this doesn't happen when setting the edit mode to a dialog like this:
Mode="EditMode.Dialog"
Hi Chris,
We are checking this from our side. We will update you further details within two business days. Until then we appreciate your patience.
Regards,
Renjith R
Thanks for your shared information. We have confirmed the reported issue is an issue at our end and this fix will be included in our upcoming patch release, which is expected to be rolled out on May 31st,2022.
You can track the status of this issue from the below feedback.
Feedback: https://www.syncfusion.com/feedback/34962
Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization
We are facing complexity to resolve this issue. We will include it in the upcoming weekly patch release.
Which is expected to be rolled out on June 15th, 2022.
Hi Chris,
We are glad to announce that the fix for the reported issue has been implemented in the weekly patch release 20.1.60. We request you to update the NuGet to the latest version to get rid of this issue.
Find the release notes here: https://blazor.syncfusion.com/documentation/release-notes/20.1.60?type=all#autocomplete
Regards,
Sureshkumar P