Here is the code for my parent grid.
@(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkViewModel>()
.Name(
"ManagementNetworkGrid"
)
.Columns(columns =>
{
columns.Bound(c => c.IpNetworkAddress);
columns.Bound(c => c.IpSubnetMask);
columns.Bound(c => c.DevicesDiscovered);
columns.Bound(c => c.DevicesPolled);
columns.Command(command => { command.Custom(
"Poll"
).Click(
"poll"
); command.Edit(); command.Destroy(); });
})
.ToolBar(toolbar =>
{
toolbar.Create();
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ClientDetailTemplateId(
"managementNetworkDetail"
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(m => m.IpNetworkAddress);
model.Field(m => m.DevicesDiscovered).Editable(
false
);
model.Field(m => m.DevicesPolled).Editable(
false
);
})
.Create(create => create.Action(
"ManagementNetworks_Create"
,
"NetworkMap"
).Data(
"AttachAntiForgeryToken"
))
.Read(read => read.Action(
"ManagementNetworks_Read"
,
"NetworkMap"
))
.Update(update => update.Action(
"ManagementNetworks_Update"
,
"NetworkMap"
).Data(
"AttachAntiForgeryToken"
))
.Destroy(destroy => destroy.Action(
"ManagementNetworks_Destroy"
,
"NetworkMap"
).Data(
"AttachAntiForgeryToken"
))
.PageSize(20)
.Sort(sort => sort.Add(s => s.IpNetworkAddress).Ascending())
)
)
And here is the code for my client detail template grid.
<script id=
"managementNetworkDetail"
type=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkDetailViewModel>()
.Name(
"ManagementNetworkGrid_#=IpNetworkAddress#"
)
.Columns(columns =>
{
columns.Bound(c => c.NetworkDeviceId);
columns.Bound(c => c.Name);
columns.Bound(c => c.Description);
columns.Bound(c => c.EthernetInterfaces);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"ManagementNetworks_Detail"
,
"NetworkMap"
,
new
{ ipNetworkAddress =
"#=IpNetworkAddress#"
}))
.Sort(sort => sort.Add(s => s.NetworkDeviceId).Ascending())
)
.ToClientTemplate()
)
</script>
However when I expand a row in the parent grid, there is no data in the child grid. Looking at the Network tab in my browser's debug tools, I can see that no GET request is being sent. There are no errors in the browser's console. Hopefully someone can help me get to the bottom of what I'm doing wrong.
Thanks in advance.