This question is locked. New answers and comments are not allowed.
Hi all,
I've downloaded the MVC extensions from NuGet and am using the Grid with ajax.
Please look at the following declaration:
When the grid originally loads, everything works as planned.
However, whenever I go to a different page or press the refresh button in the grid; in fact, whenever I do anything that calls an ajax refresh, I lose my custom column completely.
I'm not sure if this is a bug or if I'm doing this in a fashion it wasn't intended for.
For reference, here is the controller methods:
Any help is appreciated.
Thank you.
I've downloaded the MVC extensions from NuGet and am using the Grid with ajax.
Please look at the following declaration:
@(Html.Telerik().Grid(Model) .Name("Home") .DataKeys(dataKeys => dataKeys.Add(o => o.Id)) .Columns (columns => { columns.Bound(o => o.FirstName).Width(200).Filterable(true); columns.Bound(o => o.LastName).Width(200).Filterable(false); columns.Template( @<text> @if (item.VisitorStatus != null && item.VisitorStatus.Id == "P") { @Html.ActionLink("Requeue", "Requeue", "Visitor", new { area="", id = item.Id }, null) } else { @Html.ActionLink("Select", "Edit", "Visitor", new { area = "", Id = item.Id }, null) } </text> ).Title("Action"); }) .DataBinding(dataBinding => { dataBinding.Ajax().Select("_FirstLook", "AjaxSearch").Enabled(true); }) .NoRecordsTemplate("No records found") .Scrollable(scrolling => scrolling.Enabled(false)) .Sortable(sorting => sorting.Enabled(true)) .Pageable(paging => paging.Enabled(true)) .Filterable(filtering => filtering.Enabled(true)) .Groupable(grouping => grouping.Enabled(false)) .Footer(true))When the grid originally loads, everything works as planned.
However, whenever I go to a different page or press the refresh button in the grid; in fact, whenever I do anything that calls an ajax refresh, I lose my custom column completely.
I'm not sure if this is a bug or if I'm doing this in a fashion it wasn't intended for.
For reference, here is the controller methods:
[HttpPost] public ActionResult Index(VisitorSearchViewModel model) { VisitorSearchResponse response = service.FindVisitorsBy (new VisitorSearchRequest() { LastFourSSN = model.LastFourSSN, LastName = model.LastName }); if (response.Success) { Session["LastFourSSN"] = model.LastFourSSN; Session["LastName"] = model.LastName; Session["List"] = response.Visitors.ToList(); return View("VisitorList", response.Visitors.ToList()); } else { // Return a not found view... return View(); } } [GridAction] public ActionResult _FirstLook() { return View(new GridModel((List<VisitorViewModel>)Session["List"])); }Any help is appreciated.
Thank you.