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

[Solved] Ajax binding and grouping - need help

0 Answers 33 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.
Lena
Top achievements
Rank 1
Lena asked on 05 Nov 2010, 09:26 AM
Hello,
I experience the problem in grouping with ajax binding.
Actions in controller:

    public ActionResult PartialGrid()
        {
            return PartialView(new AnimalsModel().GetAnimals());
        }
        [GridAction]
        public ActionResult _PartialGrid()
        {
            return PartialView("PartialGrid", new GridModel<Animal>(new AnimalsModel().GetAnimals()));
        }

Partial view:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<LPRAjaxPartialTest.Models.Animal>>" %>
<%= Html.Telerik().Grid(Model)
        .Name("Grid")
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_PartialGrid", "Home"))
        .Pageable()
        .Sortable()
        .Filterable()
        .Selectable()
         .Groupable()
%>

View is called by link:
<li><%= Ajax.ActionLink("Load partial view", "PartialGrid", new AjaxOptions { OnSuccess = "updatePlaceholder", UpdateTargetId = "result" })%></li>

Grouping and paging do not work - impossible to drag column for grouping, when switch pages data are passed to client but not shown.
If set
.Groupable(groupable => groupable.Enabled(true).Groups(groups => groups.Add(g => g.Code)
Can not switch pages at all.

What I do wrong in binding?
Tags
Grid
Asked by
Lena
Top achievements
Rank 1
Share this question
or