Maximize productivity with
30% off* for a limited time
using BOOSTDEV30.
Includes 3- and 5-packs.
*Some exclusions may apply.New Product LaunchBoldDesk: Help desk ticketing software.
Try it for free.class ParentViewModel { public string ParentName { get; set; } public List<ChildViewModel> Children { get; set; } } class ChildViewModel { public string ChildName { get; set; } } |
Regards,
Pylori.
[Index.cshtml]
<div>
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.datasource).AllowPaging().Columns(col =>
{
...
})...Load("load").Render()
</div>
<script>
var data = @Html.Raw(Json.Encode(ViewBag.datasource));
function load(args) {
var grid = document.getElementById('Grid').ej2_instances[0]
grid.childGrid = {
dataSource: data,
queryString: 'EmployeeID',
created:created,
...
}
}
function created(args) {
this.dataSource = this.parentDetails.parentRowData.Employee; //Bind the data to Child Grid
}
</script>
|