When I enable paging and click on a number (I have 20 records per page with 393 total records), I get a postback to the page that originally "drew" the grid, i.e. the page used to select the search/selection query in order to display the specified records for the grid.
The URL in the address bar shows: localhost:27961/Home/MemberInput?ResultsGrid-page=4
MemberInput is the method in the Home controller where the Model (List) is populated from.
Here's some relevant information:
- Model in .cshtml file is defined as:
@model
List<SWApp_MVC.Models.MemberInfo>
-Grid is defined (in short) as:
@{ Html.Telerik().Grid(Model).Name(
"ResultsGrid").Columns(columns => {
columns.Template(
@<text><input name="checkedMembers" id="checkedMembers" type="checkbox"
value="@item.MemberKey" title="checkedMembers" /> </text>)
.HeaderTemplate(@<text>
<input type="checkbox" title="check all records" id="checkAllMembers" /> </text>).ClientTemplate(
"<input type='checkbox' id='chkMessage' name='checkeMembers' value='<#= MemberKey #>' />")
.Width(50).HeaderHtmlAttributes(new {style = "text-align:center"}) .HtmlAttributes(
new {style = "text-align:center"});
columns.Template(
columns.Bound(o => o.EmpID).Width(100).Title("Emp ID");
...
}).Pageable().Render();
-------------------
Any assistance would be greatly appreciated.
UPDATE: Well, I've made a bit of progress. Added the following to bottom of my grid definition:
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Paging", "Home"))
This will now call a specific method "_Paging" in my "Home" controller. In that method I have the line:
return View("GridResults", new GridModel(listOfParticipants));
Paging "sort of" works now. I can use next, last, previous, first links. The numbers disappear (page numbers) when I go to next page. May create separate post for that.