Returned duplicate data when using the API adapter

Hello,

I'm getting duplicate data when I use api adaptor.

The steps to achieve this problem were:

  1. select an element
  2. filter by anything
  3. delete everything from the filter
  4. duplicate data appears

I noticed that during the filter one request is made to the api, but when I delete the filter 4 requests are made, I don't know if this is the problem.

I put it in version 28 and it worked, it doesn't work properly in versions 29.

Any help with this problem would be appreciated.


Attachment: images_6265e8e8.zip


7 Replies 1 reply marked as answer

PK Priyanka Karthikeyan Syncfusion Team May 23, 2025 08:48 AM UTC

Hi Francisco Fernandes,


Thank you for reaching out to us, and apologies for the delay

We have prepared a sample using the MultiSelect component with remote data and tested the scenario you reported using the latest version. Based on our testing, the list items are not duplicated.

For your reference, please find the sample and a video illustration attached below.


To help us investigate further and assist you more effectively, could you please provide the following:

  • Modify the shared sample to match your specific scenario
    or

  • Share a sample that reproduces the issue

  • Provide the detailed steps to replicate the problem

Your input will greatly assist us in understanding the issue and providing you with a prompt and accurate solution.


Regards,

Priyanka K


Attachment: MultiSelect_198b7528.zip


FF Francisco Fernandes June 3, 2025 09:20 AM UTC

Sorry for the delay.

I'm sending you the zip with the sample (I didn't put the filter working because it's not necessary for the test, the error happens with it working too) and a video of what I do to get the error.


Attachment: Nova_pasta_(2)_8be042f8.zip


PK Priyanka Karthikeyan Syncfusion Team June 5, 2025 02:36 PM UTC

Hi Francisco Fernandes,


Thank you for sharing the sample.

However, the sample you provided is not runnable. As shown in the screenshot below, the application loads with minimal content and no functionality appears to be working.


Could you please share a runnable version of the sample along with the steps to run it? This will help us investigate the issue more effectively.

Thank you for your understanding and cooperation.


Regards,

Priyanka K



FF Francisco Fernandes replied to Priyanka Karthikeyan June 6, 2025 09:09 AM UTC

I tested the application again, but on a new device, and it worked after restoring the nugets and making sure that when I run the application, both the API and the frontend are started, try doing the same. If it still doesn't work, clear the cache and local storage.



PK Priyanka Karthikeyan Syncfusion Team June 9, 2025 02:30 PM UTC

Hi Francisco Fernandes,


Thank you for the update and for sharing your findings. We ran the sample in Visual Studio, and while the component rendered correctly, we noticed that the data is not loading, as the server-side call is not being triggered.




Could you please share the exact steps you followed to run the application successfully, including any specific configurations or setup you applied? This would help us replicate the working scenario more accurately on our end.


We appreciate your support and look forward to your guidance.


Regards,

Priyanka K



FF Francisco Fernandes June 11, 2025 08:35 AM UTC

I've managed to replicate the error, this is happening because the API isn't starting. Although the Profile I created has the two applications (UI and API) to start, it's only starting the UI, but I put a single project back to start and then put the one that starts both and it worked again, it must be a Visual Studio bug. But that error is because the API isn't starting, you have to make sure it does.



PK Priyanka Karthikeyan Syncfusion Team June 19, 2025 03:11 PM UTC

Hi Francisco Fernandes,


Thank you for the update.

 

We were able to reproduce the reported scenario using the shared sample. To resolve the issue of duplicate items appearing after clearing the filter text in the input, we recommend using custom filtering approach.

 

Please find the relevant code snippet and a working sample below for your reference:

 

 


<SfMultiSelect @ref="CompSecurityRequirement" TItem="DTO_MasterResourceSecurityRequirement" TValue="List<int>" @bind-Value="@SecurityRequirements" CssClass="e-outline" AllowFiltering="true" Mode="@VisualMode.CheckBox" ShowSelectAll="true" ShowDropDownIcon="true"
               FilterBarPlaceholder="Filtrar" EnableVirtualization=true ShowClearButton="true" Query="_securityRequirementQuery" FilterType="Syncfusion.Blazor.DropDowns.FilterType.Contains">
    <MultiSelectFieldSettings Text="Name" Value="Id"></MultiSelectFieldSettings>
    <SfDataManager @ref="DataOption" Url=@("https://localhost:44377/api/Master_ResourceSecurityRequirement/resourcesecurityrequirementlist")  Adaptor="@Syncfusion.Blazor.Adaptors.WebApiAdaptor" CrossDomain=true HttpClientInstance="HttpService"></SfDataManager>
    <MultiSelectEvents TItem="DTO_MasterResourceSecurityRequirement" TValue="List<int>" Filtering="OnFilter"></MultiSelectEvents>
</SfMultiSelect>

 

@code {
    private string _url = string.Empty;

 

    public List<int>? SecurityRequirements { get; set; } = new List<int>();
    SfDataManager DataOption;
    SfMultiSelect<List<int>, DTO_MasterResourceSecurityRequirement> CompSecurityRequirement { get; set; } = new();
    private Query _securityRequirementQuery = new Query().Take(100).RequiresCount();

 

    private async Task OnFilter(FilteringEventArgs args)
    {
        args.PreventDefaultAction = true;
        var query = new Query().Where(new WhereFilter() { Field = "Name", Operator = "contains", value = args.Text, IgnoreCase = true });
    
        query = !string.IsNullOrEmpty(args.Text) ? query : new Query();
        
        await CompSecurityRequirement.FilterAsync(CompSecurityRequirement.DataSource, query);
    }
}
 

 


Regards,

Priyanka K


Attachment: teste_18a704f5.zip

Marked as answer
Loader.
Up arrow icon