Hi. I'm using Kendo Grid with Hierarchy.
And in some cases I need to show expand sign(if there is any info for this row) and in some not.
Or even I can always show this sign, but I need to show different ClientDetailTemplates depending on conditions.
How can I manage this?
Here's code fragment:
@(Html.Kendo().Grid<AreaModel>()
.Name("AreaModels")
.Columns(columns =>
{
columns.Bound(o => o.AreaName).Width(101);
columns.Bound(o => o.NumberOfActiveItems).Width(101);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("HierarchyBinding_Areas", "Home"))
)
.ClientDetailTemplateId("projectsTemplate")
//.Sortable()
//.ToClientTemplate()
)
<script id="projectsTemplate" type="text/kendo-tmpl">
@(if("Some condition goes here"))
{
@Html.Label("111")
}
else
{
@Html.Label("2222")
}
</script>
And in some cases I need to show expand sign(if there is any info for this row) and in some not.
Or even I can always show this sign, but I need to show different ClientDetailTemplates depending on conditions.
How can I manage this?
Here's code fragment:
@(Html.Kendo().Grid<AreaModel>()
.Name("AreaModels")
.Columns(columns =>
{
columns.Bound(o => o.AreaName).Width(101);
columns.Bound(o => o.NumberOfActiveItems).Width(101);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("HierarchyBinding_Areas", "Home"))
)
.ClientDetailTemplateId("projectsTemplate")
//.Sortable()
//.ToClientTemplate()
)
<script id="projectsTemplate" type="text/kendo-tmpl">
@(if("Some condition goes here"))
{
@Html.Label("111")
}
else
{
@Html.Label("2222")
}
</script>