@{
var ChildGrid1 = new Syncfusion.EJ2.Grids.Grid()
{
DataSource = ViewBag.empData,
QueryString = "EmployeeID",
Created ="created",
DataBound="dataBound",
. . .
}
};
}
<ejs-grid id="PublishedGrid" dataSource="ViewBag.data" childGrid="ChildGrid1" detailDataBound="detailDataBound" allowPaging="true" >
. . .
</ejs-grid>
<script>
var val;
var flag = 1;
function detailDataBound(args) {
val = args.data;
}
function created(args) {
flag = 1;
}
function dataBound(args) {
if (flag) {
var pre = [];
// You can handle many unique columns(querystring) in Child Grid
pre.push(new ej.data.Predicate('EmployeeID', 'equal', val["EmployeeID"]));
pre.push(new ej.data.Predicate('orderid', 'equal', val["OrderID"]));
this.query = new ej.data.Query().where(new ej.data.Predicate.and(pre));
this.refresh();
flag = 0;
}
}
</script> |