I have a grid that uses detailInit and when I expand a row and select a value from the grid in the detailrow it collpases the masterrow but I have no idea on how to select and open the next row's detail cell after the masterrow is closed.
Here are some screenshots that provide a better explanation
I select a row from the detail rows grid
it closes and should look like this

Am not really sure how to accomplish this
var gridData = [{
"ID": "1",
"FName": "Adam",
"LName": "Zoo"
},
{
"ID": "2",
"FName": "Ben",
"LName": "York"
},
{
"ID": "3",
"FName": "Chris",
"LName": "Xavier"
},
{
"ID": "4",
"FName": "Dan",
"LName": "Went"
},
{
"ID": "5",
"FName": "Eddy",
"LName": "Victor"
},
{
"ID": "6",
"FName": "Freddy",
"LName": "Under"
},
{
"ID": "7",
"FName": "George",
"LName": "Trenton"
},
{
"ID": "8",
"FName": "Harry",
"LName": "Salvador"
}
];
var detailData = [{
"ID": "9",
"City": "Arlen",
"Province": "Ontario"
},
{
"ID": "10",
"City": "Bancroft",
"Province": "Ontario"
},
{
"ID": "11",
"City": "Calgary",
"Province": "Alberta"
},
{
"ID": "12",
"City": "Dartmouth",
"Province": "Ontario"
},
{
"ID": "13",
"City": "Embro",
"Province": "Ontario"
},
{
"ID": "14",
"City": "Fullerton",
"Province": "Ontario"
},
{
"ID": "15",
"City": "Georgetown",
"Province": "Ontario"
},
{
"ID": "16",
"City": "Huntsville",
"Province": "Ontario"
}
]
$(document).ready(function() {
LoadGridData();
});
function LoadGridData() {
$('#MyGrid').kendoGrid({
dataSource: {
data: gridData
},
schema: {
model: {
id: "ID",
fields: {
ID: {
type: "string"
},
FName: {
type: "string"
},
LName: {
type: "string"
}
}
}
},
columns: [{
field: "ID",
title: "ID"
},
{
field: "FName",
title: "First"
},
{
field: "LName",
title: "Last"
}
],
height: 550,
detailInit: detailInitGrid,
detailExpand: function(e) {
this.select(e.detailRow.prev());
this.collapseRow(this.tbody.find('> tr.k-master-row').not(e.masterRow));
}
});
}
var masterRow;
function detailInitGrid(e) {
masterRow = e.masterRow;
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
data: detailData
},
columns: [{
field: "ID",
title: "ID"
},
{
field: "City",
title: "City"
},
{
field: "Province",
title: "Province"
}
],
selectable: true,
change: function(e) {
let index = this.select().index();
let dataItem = this.dataSource.view()[index];
let grid = $("#MyGrid").data("kendoGrid");
$(".k-master-row").each(function(index) {
grid.collapseRow(this);
$(this).removeClass("k-state-selected");
});
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.115/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.115/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.115/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.115/styles/kendo.mobile.all.min.css">
<script src="https://kendo.cdn.telerik.com/2019.1.115/js/kendo.all.min.js"></script>
<div id="MyGrid"></div>