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.
Unfortunately, activation email could not send to your email. Please try again.

Grid doesn't show any rows

Thread ID:

Created:

Updated:

Platform:

Replies:

126945 Oct 17,2016 08:54 PM Oct 19,2016 02:50 AM ASP.NET Web Forms 3
loading
Tags: Grid
R Brian Lindahl
Asked On October 17, 2016 08:54 PM

I'm trying to get started with EJ/MVC and, to be honest, having a lot of trouble. I created a new MVC app, and followed the instructions here for how to make it into a Syncfusion app. I'm using Entity Framework with "code first" modeling.

I have a model:

    public class Group
    {
        public Guid GroupID { get; set; }
        public string Name { get; set; }
        public int SortOrder { get; set; }
    }

and a controller/view, scaffolded by the "add controller" menu, to which I added a grid:

@model IEnumerable<WebApplication4.Models.Group>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@(Html.EJ().Grid<WebApplication4.Models.Group>("GridContainer")
        .Datasource(Model)
        .Columns(col =>
        {
            col.Field("GroupID").HeaderText("ID").Add();
            col.Field("Name").HeaderText("Name").Add();
            col.Field("SortOrder").HeaderText("Order").Add();

        })
        .AllowPaging()                                                                                                              
)

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.SortOrder)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SortOrder)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.GroupID }) |
            @Html.ActionLink("Details", "Details", new { id=item.GroupID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.GroupID })
        </td>
    </tr>
}

</table>

I used the "create new" button to add a couple of rows. The rows show up in the scaffolded table, but the grid only shows the header & footer. It obviously knows that there ARE rows, as it says "2 items" in the footer. If I look at the page source, the rendered table just has a <tr> with empty <td>s in it.

I'm assuming that there is something simple and/or fundamental that I'm missing... any suggestions?

brian

Ragavee U S [Syncfusion]
Replied On October 18, 2016 05:27 AM

Hi Brian, 

Thanks for your interest in Syncfusion products. 

We have created a sample with Entity Framework Code-First approach and we are sorry that the issue is not reproduced at our end. The sample can be downloaded from the below location. 


Please try the above sample and if you still face any difficulties, please share the following details for our reference. 

1.       Video demo of the issue that you are facing. 
2.       Is there any script error or exception obtained? If so, please share the expanded screenshot of the error. 
3.       Essential studio version and browser version details 
4.       If possible, please reproduce the issue in the above provided sample and share. 

Regards, 
Ragavee U S. 


R Brian Lindahl
Replied On October 18, 2016 02:25 PM

Turns out I was failing to include jsrender.min.js on my page. With it, it displays just fine. Thanks!

Ragavee U S [Syncfusion]
Replied On October 19, 2016 02:50 AM

Hi Brian, 
  
Thanks for your update. 
 
We are happy that your issue is resolved. 
  
Regards, 
Ragavee U S. 


CONFIRMATION

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.

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.

;