I have a Kendo Grid in an MVC view. I've enabled paging, and added a check box to select the records. Everything seems to work, however when I select all items on 1 page, for some reason, all items get selected across all pages instead of just on the 1 page. If I select all items only on 1 page - all items in all subsequent pages should not be checked. Any ideas?
@(Html.Kendo().Grid(Model.ResultFiles)
.Name("Grid")
.Columns(columns => {
columns.Select().Width(50);
columns.Bound(r => r.Id).Hidden();
columns.Bound(r => r.SomeNumber).Title("Number").Filterable(f => f.Cell(cell => cell.ShowOperators(false))).ClientTemplate("#= SomeNumber# # if(!Viewed) { # <
span
id
=
'unread-#= Id #'
class
=
'badge new-results'
>New</
span
> # } #");
columns.Bound(r => r.Name).Title("Person").Filterable(f => f.Cell(cell => cell.ShowOperators(false)));
columns.Bound(r => r.DateOfBirth).Title("Date of Birth")
.ClientTemplate("#= DateOfBirthAsString#")
.Filterable(f => f.Cell(cell => cell.ShowOperators(false)));
columns.Bound(r => r.CompanyName).Hidden();
columns.Bound(r => r.SomeOtherName).Filterable(f => f.Cell(cell => cell.ShowOperators(false)));
columns.Bound(r => r.DisplayName).Title("Place").Filterable(f => f.Cell(cell => cell.ShowOperators(false)));
columns.Bound(r => r.EntryDateAsString).Title("Collection Date").Filterable(false);
columns.Bound(r => r.ReportGuid).Hidden(true);
})
.ToolBar(t => t.Template(@<
text
><
label
>Search By Entry Date Range:</
label
> <
div
class
=
"row"
> <
div
class
=
"col-md-3"
>@(Html.Kendo().DatePicker().Name("startSearch").HtmlAttributes(new { PlaceHolder = "Start Date..." }))</
div
> <
div
class
=
"col-md-3"
>@(Html.Kendo().DatePicker().Name("endSearch").HtmlAttributes(new { PlaceHolder = "End Date..." }))</
div
> <
div
class
=
"col-md-1"
><
button
class
=
"k-button"
type
=
"button"
onclick
=
"filterGrid()"
style
=
"width: 100%"
>Search</
button
></
div
> <
div
class
=
"col-md-1"
><
button
class
=
"k-button"
type
=
"button"
onclick
=
"resetFilter()"
style
=
"width: 100%"
>Reset</
button
></
div
> <
div
class
=
"col-md-1"
><
button
class
=
"k-button"
type
=
"button"
onclick
=
"downloadFiles()"
style
=
"width: 100%"
>Download</
button
></
div
> </
div
></
text
>))
.Pageable(p => p.PageSizes(new int[] { 10, 25, 50, 100 }))
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row)
.Operators(o => o
.ForString(str => str.Clear()
.Contains("Contains")
)
)
)
.DataSource(dataSource => dataSource
.Ajax()
.Sort(sort => sort.Add("EntryDate").Descending())
.Read(read => read.Action("Search", "Reports"))
.PageSize(10)
)
.PersistSelection()
)