This question is locked. New answers and comments are not allowed.
Hi,
I have tried to follow the numerous examples of ajax bound grids in tab strips in this forum, but my grid is still not working. Here is a very simplified version.
Model:
Controller:
Index View:
_TaskGrid:
What I see is that MyTasks() gets called, but is unable to render the grid, and _AjaxMyTasks is never called. I receive a server error 500. I took the advice of this blog post: http://blogs.telerik.com/aspnetmvcteam/posts/10-01-25/resolving-circular-references-when-binding-the-mvc-grid.aspx and created a separate view model, but I still have the same issue.
What am I missing, here?
I have tried to follow the numerous examples of ajax bound grids in tab strips in this forum, but my grid is still not working. Here is a very simplified version.
Model:
public class TaskViewData { [HiddenInput(DisplayValue = false)] public int Id { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "Please enter a task name.")] [DisplayName("Task Name")] public string Name { get; set; } }public ActionResult Index(){ return View();}[GridAction]public ActionResult _AjaxMyTasks(){ return View("_TaskGrid", new GridModel(db.Tasks.Where(t => t.PersonId == me.Id).Select(s => new TaskViewData { Id = s.Id, Name = s.Name })));}public ActionResult MyTasks(){ FillViewBag(); // fill the view bag with stuff we need for editing return PartialView("_TaskGrid");}@{ Html.Telerik().TabStrip() .Name("TabStrip") .Items(parent => { parent.Add() .Text("My Tasks") .Selected(true) .LoadContentFrom("MyTasks", "Tasks"); parent.Add() .Text("Team Tasks") .LoadContentFrom("TeamTasks", "Tasks"); }) .Render();}@model IEnumerable<fwf.ViewModels.TaskViewData>@using System.Collections <div> @(Html.Telerik().Grid(Model).Name("TaskGrid") .ToolBar(commands => commands.Insert()) .DataKeys(keys => keys.Add(c => c.Id)) .DataBinding(dataBinding => dataBinding .Ajax().Select("_AjaxMyTasks", "Tasks")) .Columns(c => { c.Bound(o => o.Name).Width(210); c.Command(commands => { commands.Edit(); commands.Delete(); }).Width(200); });)</div>What am I missing, here?