Hi, I'm trying to make a 3-level hierarchic grid. I've seen some example doing this but in my case the nested one is still dependent from the more external and I cannot access ID to populate it.
My code:
In the last one (Grid Room) I cannot access DayID property. How can I accomplish this?
My code:
@(Html.Kendo().Grid<
RateDayViewModel
>()
.Name("dayGrid")
.Columns(columns =>
{
columns.Bound(o => o.Date).Format("{0:d}");
})
.ClientDetailTemplateId("channelTemplate")
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.DayID);
})
.PageSize(10)
.Read(read => read.Action("ReadSummary", "Rate"))
)
.Pageable()
)
<
script
id
=
"channelTemplate"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
RateChannelViewModel
>()
.Name("day_#=DayID#")
.Columns(columns =>
{
columns.Bound(o => o.Channel.Label).Title("Channel");
})
.ClientDetailTemplateId("roomTemplate")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.ChannelID);
})
.Read(read => read.Action("ReadChannels", "Rate", new { Day = "#=DayID#" }))
)
.ToClientTemplate()
)
</
script
>
<
script
id
=
"roomTemplate"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
RateRoomViewModel
>()
.Name("room_#=DayID##=ChannelID#")
.Columns(columns =>
{
columns.Bound(o => o.Room.Label).Title("Room");
})
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.RoomID);
})
.Read(read => read.Action("ReadRooms", "Rate", new { Day = "#=DayID#", Channel = "#=ChannelID#"}))
)
.ToClientTemplate()
)
</
script
>
In the last one (Grid Room) I cannot access DayID property. How can I accomplish this?