This is a migrated thread and some comments may be shown as answers.

How Hide/Show expand sign.

0 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir Vyahov
Top achievements
Rank 1
Vladimir Vyahov asked on 28 Sep 2012, 03:57 AM
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>
                                           

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Vladimir Vyahov
Top achievements
Rank 1
Share this question
or