This question is locked. New answers and comments are not allowed.
I want to reset the grid pager to page 1.
I have a grid that is populated by selecting a value from a dropdown list. When the user selects a new value from the dropdown and submits the form I want to discard the page number and go back to page 1. Otherwise if the user is viewing page 7 of one set of results and selects a more restrictive option from the dropdown with less results then the grid comes back empty.
Here is my view code.
I have a grid that is populated by selecting a value from a dropdown list. When the user selects a new value from the dropdown and submits the form I want to discard the page number and go back to page 1. Otherwise if the user is viewing page 7 of one set of results and selects a more restrictive option from the dropdown with less results then the grid comes back empty.
Here is my view code.
| <div> |
| <% using (Html.BeginForm("Index", "Dispute", FormMethod.Post, new { name = "searchtimespan" })) { %> |
| See more: <%= Html.DropDownList("timespan", Model.DisputeCreationSpan)%> |
| <%= Html.Button("search", "Search", HtmlButtonType.Submit)%> |
| <% } %> |
| </div> |
| <% Html.Telerik().Grid<USP_Dispute_SearchResult>(Model.Disputes) |
| .Name("disputesgrid").PrefixUrlParameters(false) |
| .Columns(columns => |
| { |
| columns.Add(d => d.DisputeID).Width(50); |
| columns.Add(d => d.TerminalID).Width(50); |
| columns.Add(d => d.ResponseDueDate).Width(50); |
| columns.Add(d => d.CreateDate).Width(50); |
| columns.Add(d => |
| { |
| %> |
| <%= Html.ActionLink("Details", "Details", new { id = d.DisputeID })%> |
| <% |
| }).Title(" ").Width(50).HtmlAttributes(new { align = "center" }); |
| }) |
| .Sortable(sort => sort.SortMode(GridSortMode.SingleColumn)) |
| .Scrollable(scrolling => scrolling.Height("100%")) |
| .Pageable(paging => paging.PageSize(20).Style(GridPagerStyles.NextPreviousAndNumeric)) |
| .Render(); |
| %> |