Cannot render EJ2 Grid with model data (v22.2.12, Community License)

Hello,

I am trying to use Syncfusion EJ2 Grid in my ASP.NET MVC (.NET Framework 4.8) project. My version is 22.2.12 and I am using the Community License.

My goal is to display model data in the Grid, but the Grid is not rendering. Below is my code:

@{

    var gridData = Model.Opportunity.Select(o => new

    {

        OpportunityId = o.OpportunityId,

        OpportunityName = o.OpportunityName

    }).ToList();

}


<div class="control-section">

    @Html.EJS().Grid("LocalData")

        .DataSource(gridData)

        .Columns(col =>

        {

            col.Field("OpportunityId")

                .HeaderText("Opportunity ID")

                .Width("120")

                .TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right)

                .IsPrimaryKey(true)

                .ValidationRules(new { required = true, number = true })

                .Add();


            col.Field("OpportunityName")

                .HeaderText("Opportunity Name")

                .Width("150")

                .ValidationRules(new { required = true, minLength = 5 })

                .Add();

        })

        .AllowPaging()

        .PageSettings(page => page.PageCount(5))

        .AllowSorting()

        .AllowFiltering()

        .FilterSettings(filter =>

        {

            filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel);

        })

        .EditSettings(edit =>

        {

            edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true);

        })

        .Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })

        .Render()

</div>



1 Reply

JC Joseph Christ Nithin Issack Syncfusion Team August 27, 2025 11:47 AM UTC


Hi Oguz,


Greetings from Syncfusion support.


Based on your query, you are trying to render the grid using model data but the grid is no rendered. We have already discussed how to render the EJ2 Grid in detail in the below documentation as a step-by-step procedure. Please ensure if you have followed all the steps in the below documentation.


Documentation: https://ej2.syncfusion.com/aspnetmvc/documentation/grid/getting-started-mvc


If you are able to render the grid and the data is not showing, kindly refer the below documentation to troubleshoot the issue.


Documentation: https://ej2.syncfusion.com/aspnetmvc/documentation/grid/data-binding/data-binding#troubleshoot-syncfusion-aspnet-mvc-grid-render-rows-without-data


Regards,

Joseph I.


Loader.
Up arrow icon