So I have an issue where if there are two grids on the same page using different names and both having a column that uses the ".Select()" method for checkboxes, the "select all" checkbox in the header of one of the grids works correctly, but the second one will only select the first one's rows and not it's own.
Here is some sample code:
<div
class
=
"row"
>
<div
class
=
"col-xs-12 col-md-6"
>
<h2
class
=
"text-center"
>Users
in
rule</h2>
@(Html.Kendo().Grid<UserViewModel>()
.Name(
"UsersInRule"
)
.Columns(columns =>
{
columns.Select().Width(50);
columns.Bound(c => c.Name).Width(300);
columns.Bound(c => c.Username).Width(200);
})
.Sortable()
.Resizable(resize => resize.Columns(
true
))
.ToolBar(toolbar => toolbar.Create())
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"ListUsersInRule"
,
"User"
,
new
{ Area =
"Admin"
, id = Model.Id }))
)
)
</div>
<div
class
=
"col-xs-12 col-md-6"
>
<h2
class
=
"text-center"
>Available users</h2>
@(Html.Kendo().Grid<UserViewModel>()
.Name(
"AvailableUsers"
)
.Columns(columns =>
{
columns.Select().Width(50);
columns.Bound(c => c.Name).Width(300);
columns.Bound(c => c.Username).Width(200);
})
.Sortable()
.Resizable(resize => resize.Columns(
true
))
.ToolBar(toolbar => toolbar.Create())
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"ListUsersNotInRule"
,
"User"
,
new
{ Area =
"Admin"
, id = Model.Id }))
)
)
</div>
</div>
What happens is when I click on the header checkbox for the "AvailableUsers" grid, it will select the rows in the "UsersInRule" grid. The header checkbox in the "UsersInRule" grid works just fine in selecting rows in its own grid. How do I configure it so that the header checkboxes will only select the rows in their own grid?
Currently using Kendo UI v2017.3.1026 (kendo.all.min.js and kendo.aspnetmvc.min.js) that I grabbed from the telerik.ui.for.aspnet.core commercial zip.