===================================================
#= firstName# (Bind main Grid)
===================================================
\\#=Media\\# (Bind data in Sub-grid)
===================================================
@(Html.Kendo().Grid<DbModels.Test>()
.Name("grdTest")
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate("<img src='/images/icon-1.png' />").Width(50).Title("");
columns.Template(e => { }).ClientTemplate("<table><tr><td class='name k-hierarchy-cell'><a class='k-plus' href='javascript:void(0);'>#= firstName#</a></td></tr><tr><td><div class='m-b5'>DOB: 07/03/13<br></div>Entry: 07/03/13</td></tr></table>").Width(200).Title("");
columns.Template(e => { }).ClientTemplate("<div class='m-b5'>Test ID: <span class='blue-light'>781923</span><br></div>Call-In ID: <span class='blue-light'>5439</span>").Title("");
columns.Template(e => { }).ClientTemplate("<div class='m-b5'>Last Test:<br></div><span class='blue-light'>781923</span>").Title("");
})
.ClientDetailTemplateId("template")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetTestData", "CaseManager"))
)
)
<script id="template" type="text/kendo-tmpl">
<div class="sub-table">
@(Html.Kendo().Grid<DbModels.Referral>()
.Name("grdReferral_#=id#")
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate("<span class='text14'>TACO1xW</span><span class='pass'>Pass</span>").Title("");
columns.Template(e => { }).ClientTemplate("<span class='active-txt'>Active<br></span>\\#=kendo.toString(StartDate, 'dd/MM/yyyy')\\# - \\#=kendo.toString(EndDate, 'dd/MM/yyyy')\\#").Title("");
columns.Template(e => { }).ClientTemplate("THC/PCP/ECS<br>SPI/COC/HER<span class='media'>Media: \\#=Media\\#</span>").Title("");
columns.Template(e => { }).ClientTemplate("<a href=''><img src='/images/edit-icon.png' border='0' alt='Edit'></a>").Title("");
columns.Template(e => { }).ClientTemplate("<a href=''><img src='/images/calendar-icon.png' border='0' alt='Calendar'></a>").Title("");
})
.DataSource(dataSource => dataSource
.Ajax().ServerOperation(true)
.Read(read => read.Action("GetTestReferralData", "CaseManager", new { TestId = "#= id#" }))
)
.ToClientTemplate()
)
</div>
</script>
#= firstName# (Bind main Grid)
===================================================
\\#=Media\\# (Bind data in Sub-grid)
===================================================
@(Html.Kendo().Grid<DbModels.Test>()
.Name("grdTest")
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate("<img src='/images/icon-1.png' />").Width(50).Title("");
columns.Template(e => { }).ClientTemplate("<table><tr><td class='name k-hierarchy-cell'><a class='k-plus' href='javascript:void(0);'>#= firstName#</a></td></tr><tr><td><div class='m-b5'>DOB: 07/03/13<br></div>Entry: 07/03/13</td></tr></table>").Width(200).Title("");
columns.Template(e => { }).ClientTemplate("<div class='m-b5'>Test ID: <span class='blue-light'>781923</span><br></div>Call-In ID: <span class='blue-light'>5439</span>").Title("");
columns.Template(e => { }).ClientTemplate("<div class='m-b5'>Last Test:<br></div><span class='blue-light'>781923</span>").Title("");
})
.ClientDetailTemplateId("template")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetTestData", "CaseManager"))
)
)
<script id="template" type="text/kendo-tmpl">
<div class="sub-table">
@(Html.Kendo().Grid<DbModels.Referral>()
.Name("grdReferral_#=id#")
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate("<span class='text14'>TACO1xW</span><span class='pass'>Pass</span>").Title("");
columns.Template(e => { }).ClientTemplate("<span class='active-txt'>Active<br></span>\\#=kendo.toString(StartDate, 'dd/MM/yyyy')\\# - \\#=kendo.toString(EndDate, 'dd/MM/yyyy')\\#").Title("");
columns.Template(e => { }).ClientTemplate("THC/PCP/ECS<br>SPI/COC/HER<span class='media'>Media: \\#=Media\\#</span>").Title("");
columns.Template(e => { }).ClientTemplate("<a href=''><img src='/images/edit-icon.png' border='0' alt='Edit'></a>").Title("");
columns.Template(e => { }).ClientTemplate("<a href=''><img src='/images/calendar-icon.png' border='0' alt='Calendar'></a>").Title("");
})
.DataSource(dataSource => dataSource
.Ajax().ServerOperation(true)
.Read(read => read.Action("GetTestReferralData", "CaseManager", new { TestId = "#= id#" }))
)
.ToClientTemplate()
)
</div>
</script>
Comments
Post a Comment