On GridTwo set the AutoBind to false, for example
@(Html.Kendo().Grid<myclass>()
.Name("MyGridTWO")
.Events(events => events.DataBound("onG2DataBound"))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Read(read => read.Action("MyGridTwoListAjax", controller))
.PageSize(Constants.PageSize)
.Filter(filters => { filters.Add(c => c.MyField).IsEqualTo(0); })
)
.AutoBind(false) </myclass>
Then perform a fetch in the databound event for GridOne
function onG1DataBound() {
$("#MyGridONE").find(".k-grid-toolbar").insertBefore($("#MyGridONE.k-pager-wrap"));
var gridTwo = $("#MyGridTWO").data("kendoGrid");
if(gridTwo != null)
gridTwo.dataSource.fetch();
}
The autobind false tells grid 2 to wait on binding its data. Placing the fetch of grid 2 data in the databound of grid 1 lets us know we have data in the 1st grid before we fetch data for the 2nd grid.