View
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(e => e.AssessmentID).Width(110);
columns.Bound(e => e.AssessmentName).Width(110);
})
.Sortable()
.Pageable()
.Scrollable()
.ClientDetailTemplateId("scorelist")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.ServerOperation(false)
)
.Events(e => e.DetailInit("detailInit"))
)
<script id="listviewTemplate" type="text/kendo-tmpl">
<div class="StudentResultItem">
<p>#=ResultValue#</p>
</div>
</script>
<script id="scorelist" type="text/kendo-tmpl">
@(Html.Kendo().ListView<AssessmentScoreModel>()
.Name("Scores_#=AssessmentID#")
.TagName("div")
.ClientTemplateId("listviewTemplate")
.HtmlAttributes("class='StudentResultItems'")
.ToClientTemplate()
)
</script>
Model:
public class StudentResultModel
{
public int AssessmentID { get; set; }
public string AssessmentName { get; set; }
public List<AssessmentScoreModel> ResultItem { get; set; }
}
public class AssessmentScoreModel
{
public int ResultID { get; set; }
public string ResultValue { get; set; }
}
When I run it, it can not show listview