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

The data is not displayed in the grid

.NET Core 3.1 Preview 1
ej2 17.3.26
Hosted core
@page "/AllergyCategoriesPage"
@inject HttpClient http
<EjsGrid  @ref="@grid" TValue="AllergyCategories" EnableRtl="true" AllowFiltering="true" AllowResizing="true" AllowSorting="true" AllowTextWrap="true" ShowColumnChooser="true" ShowColumnMenu="true" GridLines="@GridLine.Both" Height="100%" AllowGrouping="true" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
    <EjsDataManager Adaptor="Adaptors.WebApiAdaptor" Url="api/AllergyCategories"></EjsDataManager>
    <GridFilterSettings Type="@Syncfusion.EJ2.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
    <EjsPager PageSize="12"></EjsPager>
    <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
        <GridColumn Field=@nameof(AllergyCategories.AllergyCategoryId) HeaderText="AllergyId" TextAlign="@TextAlign.Center" IsPrimaryKey="true" IsIdentity="true"></GridColumn>
        <GridColumn Field=@nameof(AllergyCategories.AllergyCategoryName) HeaderText="AllergyName" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true })"></GridColumn>

   EjsGrid<AllergyCategories> grid;

    public class AllergyCategoriesController : ControllerBase
       private readonly AllergyCategoriesDataAccessLayer db = new AllergyCategoriesDataAccessLayer();

        public object Get()
            IQueryable<AllergyCategories> data = db.GetAll();
            var count = data.Count();
            var queryString = Request.Query;
            if (queryString.Keys.Contains("$inlinecount"))
                StringValues Skip;
                StringValues Take;
                int skip = (queryString.TryGetValue("$skip", out Skip)) ? Convert.ToInt32(Skip[0]) : 0;
                int top = (queryString.TryGetValue("$top", out Take)) ? Convert.ToInt32(Take[0]) : data.Count();
                return new { Items = data.Skip(skip).Take(top), Count = count };
                return  data;

3 Replies

VN Vignesh Natarajan Syncfusion Team November 7, 2019 05:24 AM UTC

Hi Ebi Torabi,  

Thanks for contacting Syncfusion forums.  

Query: “the data is displayed in grid” 

We have analyzed your code example and we suspect that you are facing Camel Case issue in Asp.Net Core. Normally, ASP.NET Core 1.0+ framework has camel casing issues while serializing the JSON Object. If you are facing the same camel casing issue while running the sample then please use the below codes in Startup.cs file to overcome that casing issue in Application level.  
In the below code, we have called the ContractResolver options under the Startup.cs file to avoid camel casing conversion during the serialization process. The is related to ASP.NET Core specifics and we suggest refer to the following article which describes how to overcome a similar issues. 
Please use the code below, 

        public void ConfigureServices(IServiceCollection services) 
            services.AddMvc().AddNewtonsoftJson(options => { 
                options.SerializerSettings.ContractResolver = new DefaultContractResolver(); 

Refer our UG documentation for your reference 

If you are not facing the camel case issue or above solution does not resolve your query, kindly get back to us with details regarding the data returned from server (console -> network tab -> response window screenshot). 

Vignesh Natarajan 

ET ebi torabi November 7, 2019 09:05 AM UTC

Hi Unfortunately, it doesn't work on the Hosted core. Please give an example in Hosted core.

VN Vignesh Natarajan Syncfusion Team November 8, 2019 10:13 AM UTC

Hi Ebi, 

Query: “Hi Unfortunately, it doesn't work on the Hosted core. Please give an example in Hosted core. 

As per your request, we have prepared a Hosted application in .Net Core 3.1 Preview 1 using our latest version Nuget package ( We are able to bind data properly from WebAPI controller to Grid. Kindly download the sample from below.  

After referring the sample if you are still facing the issue, kindly get back to us with more details.     

Vignesh Natarajan. 

Live Chat Icon For mobile
Up arrow icon