This is a migrated thread and some comments may be shown as answers.

Server Binding Data for Kendo Grid Not Being Created

4 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anderson
Top achievements
Rank 1
Anderson asked on 16 Jan 2014, 12:48 AM
Hi,
I'm having some trouble with the Kendo Grid not being created at all in my webpage.
I followed this tutorial:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/server-binding#client-side-events-and-server-binding
and tried all the methods provided.
I've verified that the connection DOES work, and that I can get data from the server.

Here's my Controller:
public ActionResult Output()
{
    ViewBag.Message = "Location Name/Address Here";
    ViewBag.Link = "Location";
 
    var fcon = new FruitEntities().Fruits;
    ViewBag.Fruits = fcon;
     
    return View();
}
Here's my View:
@{
 
    ViewBag.Title = "Title";
     
}
 
<h2>Some grid should be here......</h2>
 
@{Html.Kendo().Grid<HR360Dashboard.Models.Fruit>()
      .Name("Grid")
      .BindTo((IEnumerable<HR360Dashboard.Models.Fruit>)ViewBag.Fruits)
      .Columns(columns =>
      {
          columns.Bound(p => p.Fruit_ID);
          columns.Bound(p => p.Name);
          columns.Bound(p => p.Color);
      })
      .Pageable();
}
I've checked using dev tool inspectors, and the grid doesn't show up at all.

Help Please! Thanks

4 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 16 Jan 2014, 12:05 PM
Hello Anderson,

I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please provide a runnable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior and advise you further.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Anderson
Top achievements
Rank 1
answered on 16 Jan 2014, 04:55 PM
I've attached a project with the issue re-created.
The Index page should display the Grid, but it is nowhere to be seen.
The About page displays the data grabbed from the database.

You may need to create your own db, since its attached to our local active directory database.

The packages folder is missing because I couldn't attach the entire thing in one go.
0
Anderson
Top achievements
Rank 1
answered on 16 Jan 2014, 04:57 PM
Here's the packages folder
0
Alexander Popov
Telerik team
answered on 20 Jan 2014, 09:40 AM
Hello again Anderson,

Thank you for the provided project. I reviewed it and noticed that the Grid is wrapped in a code block, thus it is not being rendered. Try replacing the curly brackets with parentheses, for example:  
@(Html.Kendo().Grid<GridTester.Models.Fruit>()
      .Name("Grid")
      .Pageable()
      .BindTo((IEnumerable<GridTester.Models.Fruit>)ViewBag.Fruits)
      .Columns(columns =>
      {
          columns.Bound(p => p.Fruit_ID);
          columns.Bound(p => p.Name);
          columns.Bound(p => p.Color);
      })
)


Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Anderson
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Anderson
Top achievements
Rank 1
Share this question
or