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

[Solved] Grid Ajax (use ADO Entity Framework) - no working

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jack
Top achievements
Rank 1
Jack asked on 13 Nov 2011, 10:31 AM

I have grid which does ajax binding.

View

@(Html.Telerik().Grid<TelerikAjaxGrid.Models.Orders>()

    .Name("OrdersGrid")

    .Columns(columns =>

    {

        columns.Bound(c => c.OrderID).Width(200);

        columns.Bound(c => c.ShipName);

        columns.Bound(c => c.ShipAddress);

    })

    .DataBinding(dataBinding => dataBinding.Ajax().Select("_Select", "Home"))

    .Sortable()

    .Pageable()

    .Groupable()

    .Filterable()

)

(I also was inserted all requied component in _Layout.cshtml)


Controller

[GridAction]

public ActionResult _Select()

{

    var _entities = new NorthwindEntities();

    var _orders = _entities.Orders.ToList();

    return View(new GridModel(_orders));

}


The grid shows up, but there is no data in it.??!!

And i find out error with firebug (browse with Firefox) in Console:

POST http://localhost:4646/Customer/_Select

500 Internal Server Error

 


Regards,
Jack Strong
------------------
My project in attachment (use Northwind db)

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 14 Nov 2011, 11:55 AM
Hello Jack,

Basically the exact error message can be seen by examining the response tab (in Firebug) of the request. I assume that the error is caused during the invocation of the action method and is because there is a circular reference in the objects used to databind the Grid. If this is the case, there are several solutions which can be found in the documentation on the Troubleshooting section.

If this is not the error please let us know what is the actual error message so we can investigate further.

Regards,

Pesho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Jack
Top achievements
Rank 1
answered on 15 Nov 2011, 11:11 AM
i was also read a same topic and tried with other db (no table relationship) and GridAjax load success.
(http://blogs.telerik.com/aspnetmvcteam/posts/10-01-25/resolving-circular-references-when-binding-the-mvc-grid.aspx)

Thank you so much for your support!

I'm trying this way.
------------
Regard,
Jack
Tags
Grid
Asked by
Jack
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Jack
Top achievements
Rank 1
Share this question
or