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

[Solved] Grid Ajax data binding fails on paging/sorting etc

2 Answers 183 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.
Dennis Gundersen
Top achievements
Rank 1
Dennis Gundersen asked on 02 Oct 2010, 05:56 PM
Hi

I've implemented RadGrid in an MVC 2 application. Server binding works, but I updated it to Ajax binding. The page now comes up with the data initially, but when I try to page, sort, filter etc, I get "Error! The requested URL returned 500 - Internal Server Error". The problem should therefore be the with the action, but I can't see what could be wrong.

I'm using VS2010 Pro, SQL 2008R2, EF 4 and C# on Win7. Telerik MVC is 2010.2.825 demo version.
           <%
        Html.Telerik().Grid(Model)
            .Name("grdPeople")
            .DataBinding(d => d
                .Ajax().Select("AjaxList", "Person")
             )
            .Pageable()
            .Sortable()
            .Filterable()
            .Groupable()
            .Render();
         %>
           [GridAction]
        public ActionResult AjaxList()
        {
            return View(new GridModel(people.GetPeople()));
        }
           public IQueryable<Person> GetPeople()
        {
            return from p in db.People
                   .Include("Status")
                   .Include("City")
                   .Include("Country")
                   orderby p.FirstName, p.LastName
                   select p;
        }

Any ideas?

Re
Dennis

2 Answers, 1 is accepted

Sort by
0
Project House
Top achievements
Rank 1
answered on 24 Oct 2010, 05:42 PM
Hi,

We are having the same problem here, even if we try to use CustomBinding, with ajax paging / sorting fails it looks like telerik team has posted reasons & workarounds (here, hiding navigation properties lead another error) for this behaviour but for EF4 case the suggested workaround does not solve the problem as expected, leaving us with another error.

Basically, it is mentioned that if you have circular references in your DB this would be the expected outcome but in our case, even there is no circular references, grid returns same error on ajax operations. Only DB Entities which has no relations are working fine right now.
0
Atanas Korchev
Telerik team
answered on 25 Oct 2010, 08:06 AM
Hi Onur Buyukcaglar,

 I war not sure if this is the exact same problem. Could you please provide a sample project which reproduces the exception you are observing? Thanks.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Dennis Gundersen
Top achievements
Rank 1
Answers by
Project House
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or