We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error with EjsGrid

Thread ID:





149938 Dec 15,2019 05:53 PM UTC Dec 18,2019 05:17 AM UTC Blazor 3
Tags: Grid
Asked On December 16, 2019 07:23 AM UTC

I'm testing the Blazor grid component with my entity framework classes, I don't understand why I get this error when I use the TtkTicket object. With other types of objects it looks ok. My code is this:

@page "/fetchdata"

@using Syncfusion.EJ2.Blazor.Grids
@using Microsoft.EntityFrameworkCore

@*@inject WeatherForecastService ForecastService*@

Grid test

@if (tickets == null)



@code {
    public customerContext _context { get; set; }
    public IQueryable tickets { get; set; }

    protected override void OnInitialized()
        _context = new customerContext();
            tickets = _context.TtkTicket.Select(x => new TtkTicket{ TicketId = x.TicketId, TicketCode = x.TicketCode, StartDate = x.StartDate, Number = x.Number, Protocol = x.Protocol}).AsQueryable();
        catch(Exception ex)


the error is:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: BlazTempId_1215471834)
 ---> System.ArgumentException: An item with the same key has already been added. Key: BlazTempId_1215471834

Attched the project and erros.

Attachment: BlazorApp2_a02a8ca9.zip

Renjith Singh Rajendran [Syncfusion]
Replied On December 16, 2019 01:14 PM UTC

Hi adrianodn, 

Thanks for contacting Syncfusion support. 

The reported issue might occur while inserting/having with duplicate primaryKey value in database or while inserting a dictionary values into database. So kindly ensure that you are inserting/having records in database with unique primary key values.   

If you are still facing the issue, even after ensuring the above scenario. Kindly confirm the following details about your dataSource.  

  1. Have you bound Grid with large dataSource?. If yes, kindly get back to us with type of dataSource and count.
  2. Because reported issue might also occur when dataSource is large. 

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

And also we are facing the below script error “The server was not found or was not accessible” when try running the attached sample.  


Renjith Singh Rajendran. 

Replied On December 17, 2019 06:51 PM UTC

Thanks for the reply. Yes the datasource contains about 180000 rows and I made sure that there are no duplicates on the primary key.
I updated the components to version

I think i have solved by follow this doc page.

Thank you!!

Renjith Singh Rajendran [Syncfusion]
Replied On December 18, 2019 05:17 AM UTC

Hi adrianodn, 

Thanks for your update. 

We are glad to hear that you have resolved your problem. 

Please get back to us if you need further assistance. 

Renjith Singh Rajendran. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon