BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@(Html.EJ().Grid<object>("HierarchyGrid") .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource) .ChildGrid(child => .ClientSideEvents(eve => { eve.Create("childCreate"); });
})
<script type="text/javascript"> function childCreate(args) {
this.getHeaderTable().remove(); |
<style type="text/css"> .e-childGrid .e-row { background-color: grey; } .e-childGrid .e-alt_row { background-color:lightgrey; } </style>
@(Html.EJ().Grid<object>("HierarchyGrid") . . . . . . . . . . . . .ChildGrid(child => { . . . . . . . . //Adding class for the child grid element .CssClass("e-childGrid")
})
)
|
@(Html.EJ().Grid<object>("HierarchyGrid")
)
<script type="text/javascript">
function dataBound(args) { if (args.data.City == "London") this.expandCollapse($(args.row.find(".e-detailrowcollapse"))); } </script> |
We have analyzed your requirement and we can achieve it partially. If we add a cell for the particular child row, then the next child rows gets misaligned due to the addition of an extra “td” element to the row.
To avoid this, we have loaded the text to the existing child row cell instead of adding a new cell in “DataBound” event of the parent Grid as follows,
@(Html.EJ().Grid<object>("HierarchyGrid") . . . . . . . . .ClientSideEvents(eve => { eve.DataBound("dataBound").RowDataBound("rowDataBound");}) .ChildGrid(child => { child.Datasource((IEnumerable<object>)ViewBag.datasource1) .QueryString("EmployeeID") . . . . . . . . })
)
<script type="text/javascript"> function dataBound(args) {
$(".btn").ejButton({
text: "click", click: function (args) { $(this.element.closest("tr").find("td")[1]).load("/Grid/GetData", {data: parseInt($(this.element.closest("tr").find("td")[1]).text()) });
} }); }
|
@(Html.EJ().Grid<object>("HierarchyGrid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource) .Adaptor(AdaptorType.RemoteSaveAdaptor)) . . . . .ChildGrid(child => //child grid
{ . . . . . . . . .ClientSideEvents(eve => { eve.Create("childCreate"); }); //create event in child grid
})
)
<script type="text/javascript"> function childCreate(args)
{
this.getHeaderTable().remove();
} </script> |