This question is locked. New answers and comments are not allowed.
Hi friends.
I have a Telerik Grid and I am using Ajax Binding.
One of the grid is working fine, but the same other grid is not working.
the problem is that, it continuous calling the select method which return the data to bind with grid.
my code for ajax binding (this one is not working) It Continuous calling the _SelectAjaxBinding() Method.
Controller
And the following Grid is working Perfect:
Controller
So Dear friends, can you please help me to point out the problem...???
I have a Telerik Grid and I am using Ajax Binding.
One of the grid is working fine, but the same other grid is not working.
the problem is that, it continuous calling the select method which return the data to bind with grid.
my code for ajax binding (this one is not working) It Continuous calling the _SelectAjaxBinding() Method.
<%= Html.Telerik().Grid<QuestionAnswer.Models.Answers>() .Name("Grid") .DataKeys(keys => { keys.Add(p => p.Answer_ID); }) .ToolBar(commands => { commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }); }) .DataBinding(dataBinding => { dataBinding.Ajax() .Select("_SelectAjaxBinding", "Answer") .Insert("_InsertAjaxEditing", "Answer") .Update("_SaveAjaxEditing", "Answer") .Delete("_DeleteAjaxEditing", "Answer"); }) .Columns(columns => { columns.Bound(p => p.Answer).Width(210); columns.Bound(p => p.Points).Width(210); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.ImageAndText); commands.Delete().ButtonType(GridButtonType.ImageAndText); }).Width(200).Title("Commands"); }) .Editable(editing => editing .Mode(GridEditMode.InLine)) .ClientEvents(events => events.OnError("onError"))//.OnEdit("onEdit")) .Pageable() .Scrollable() .Sortable()%>Controller
[GridAction] public ActionResult _SelectAjaxBinding() { return View(new GridModel(AnswersRepository.All())); }And the following Grid is working Perfect:
<%= Html.Telerik().Grid<QuestionAnswer.Models.Que_AnsMetaData>() .Name("Grid") .DataKeys(keys => { keys.Add(p => p.Que_Ans_ID); }) .ToolBar(commands => { commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }); }) .DataBinding(dataBinding => { dataBinding.Ajax() .Select("_SelectAjaxBinding", "QuestionAnswer") .Insert("_InsertAjaxEditing", "QuestionAnswer") .Update("_SaveAjaxEditing", "QuestionAnswer") .Delete("_DeleteAjaxEditing", "QuestionAnswer"); }) .Columns(columns => { //columns.Bound(p => p.Question_ID).ClientTemplate("<label> <#= Question #> </label>"); //columns.Bound(p => p.Answer_ID).ClientTemplate("<label> <#= Answer #> </label>"); columns.Bound(p => p.Question_ID); columns.Bound(p => p.Answer_ID); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.ImageAndText); commands.Delete().ButtonType(GridButtonType.ImageAndText); }).Width(200).Title("Commands"); }) .Editable(editing => editing .Mode(GridEditMode.InLine)) .ClientEvents(events => events.OnError("onError"))//.OnEdit("onEdit")) .Pageable() .Scrollable() .Sortable()%>Controller
[GridAction] public ActionResult _SelectAjaxBinding() { return View(new GridModel(Que_AnsRepository.All())); }So Dear friends, can you please help me to point out the problem...???