0

I have a view with telerik grid.

Ihave a controler code which I am passing the data to the view

public ActionResult GridList(int id)
        {
             _genrepo.GetCategoriesForControlPlanTemplateByControlPlanID(CurrentHealthPlanId,id);

            return PartialView(_viewModel);
        }

Hunter: here is my grid

<%= Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(o => o.OrderID).Width(100);
            columns.Bound(o => o.ContactName).Width(200);
            columns.Bound(o => o.ShipAddress);
            columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
        })
        .DataBinding(dataBinding => 
        {
            dataBinding.Server().Select("FirstLook", "Grid", new { ajax =
                ViewData["ajax"] });
            dataBinding.Ajax().Select("_FirstLook",
                "Grid").Enabled((bool)ViewData["ajax"]);
        })
        .Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"]))
        .Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"]))
        .Pageable(paging => paging.Enabled((bool)ViewData["paging"]))
        .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
        .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
        .Footer((bool)ViewData["showFooter"])
%>

I am able to display the data perfectly in to the grdi with pagging.. but problem is when I hit the second page.. the whole grid showing me in a static page. I am not able to see the grid.. I hope its a partial view problem.. I am not able to implement pagging sorting and filtering on partial view page?

can any body help me out how to avoid this situation to work on partial views?

thanks in advance

1
  • what does your grid initializer look like? Commented Dec 2, 2010 at 18:06

1 Answer 1

1

There's an example illustrating how to implement paging with the Telerik Grid component for ASP.NET MVC.

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

2 Comments

Thanks Darin, i dint see any examples which is about partial view problem? and even in partial views my grid sorting and paggig not working that is my problem..
You don't need partials. Notice how the controller action is prefixed with _ and decorated with the [GridAction] attribute. Behind the scenes it uses JSON which is better than partials.

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.