The detail template grid is not binding the data properly. If I expand one by one from top to bottom, it only binds the data for the first row and the grid inside all other rows are empty. If I expand them from bottom to top, it binds the data properly for all the rows. Any idea why it's doing this?
@(Html.Kendo().Grid<EmailInvitationViewModel>()
.Name("EmailInviteeGrid")
.Columns(columns =>
{
columns.Bound(e => e.EmailInviteID).Hidden(true);
columns.Bound(e => e.InvitationDate).Title("Invited On").Hidden(false);
columns.Bound(e => e.ClassDetails).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains"))).Title("Class Details");
})
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.ClientDetailTemplateId("template")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("GetAllInvitedEvents", "Controller", new { Model.EventID }))
))
)
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<EmailInvitationViewModel>()
.Name("grid_#=EmailInviteID#")
.Columns(columns =>
{
columns.Bound(o => o.GridInviteeEmail);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("GetAllInviteeEmailsByEvent", "DataSource", new { EventID = "#=EventID#", EmailInviteID = "#=EmailInviteID#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
Thank tou for that and do understand rhis part. But try expqnd all in child grid. Not the first or last all of rhem. You will see if that on all child rows are populated.
Therefore you have to use jQuery to pipulate the child grid. We jave solved this by amnesi g the older version by tweeking th code a bit.
i would like to see what ypur solution is. I will share once you have posted a solution.
Thanks
Kind Regards Xen
Hi Xenophon,
Feel free to correct me if I misunderstood something. The needed result is to expand all the rows of the parent Kendo UI Grid?
If this is the case, I would recommend using the "DataBound" Event of the Grid.
In the Event handler use the following for expanding all the rows:
this.expandRow(this.tbody.find("tr.k-master-row"));
I hope this information helps. Let me know if further assistance or information is needed.
Looking forward to hearing back from you.
Best Regards,
Anton Mironov