0

I'm trying to use Telerik ASP.net MVC Grid, and find a problem.

When I use a grid in an ordinary View with Ajax binding, it works well. However, when I put the grid in a partial View that is loaded by an Ajax call, the grid's Ajax binding does not work then. From firebug, I find the ajax request for getting data did not send to server side.

I find a similar question in stackoverflow : Telerik MVC: Loading Grid with ajax request don't work , but don't find solution.

Thank you!

1
  • it's working fine for me. can u show some code? Commented Apr 26, 2011 at 4:37

3 Answers 3

2

I also have same problem and i find the solution basically it is due to telerik javascript file.

<%: Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)) %>

copay and paste that code In master page before end of the body or if you are not using master page then place it on every page where u use ajax binding of telerik .

Sign up to request clarification or add additional context in comments.

Comments

0

the reason is I used ClientEvents as below:

Html.Telerik().Grid(Model)
.....
.Selectable()
.ClientEvents(e => e.OnRowSelected("onRowSelected"))

and I put the js code of onRowSelected handler after the grid.

When I move the js code of onRowSelected before the grid, it works.

Comments

0

Try this in the OnSuccess event of the ajax call (in the AjaxOptions of the Ajax.ActionLink or Ajax.BeginForm)

OnSuccess = "function () {var html = $('#grid').html();$('#grid').html(html);}"

This force the ajax call for getting data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.