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

[Solved] Maintaining grid state

0 Answers 117 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.
Binu
Top achievements
Rank 1
Binu asked on 25 Oct 2010, 11:31 PM
I have a grid with custom data binding, I have a column for Delete that calls an action on controller and then redirects to this page again. I want to retain the state of the grid (page, filters, etc.) How can I make the ActionLink/Client side link so that this information is send always to the controller as gridCommand parameter, note that I am doing Custom Binding (Ajax) for Paging, Sort, etc.
My grid markup is given below:
Html.Telerik().Grid(Model.GroupSummaries.Data)
        .DataBinding(binding => binding.Ajax().Select("SummaryGridBinding", "Modeling"))
        .Name("GroupSummary")
        .HtmlAttributes(new { style = "white-space: nowrap" })
        .Columns(columns =>
                    {
                        columns.Bound(s => s.Name).Width(200);
                        columns.Template(s => Html.ActionLink("Delete", "DeleteSummary", new { s.Id }))
                                    .ClientTemplate("<a href=\"" + Url.Action("DeleteSummary", "Summary") + "/<#= Id#>\">Delete</a>")
                                    .Title("Delete")
                                    .Width(50);
                    }
        )
        .Pageable(pager => pager
                        .Style(GridPagerStyles.NextPreviousAndNumeric)
                        .PageSize(10)
                        .Total(Model.GroupSummaries.Total)
                        .Enabled(true)
        )
        .Sortable(
            sorter => sorter                   
                        .SortMode(GridSortMode.SingleColumn)
        )
         
        .Filterable()
        .Scrollable(scroll => scroll.Height(320))
        .Resizable(resizing => resizing.Columns(true))
        .EnableCustomBinding(true)
        .Render();

Thanks for your help.
-Binu
Tags
Grid
Asked by
Binu
Top achievements
Rank 1
Share this question
or