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

Don't display folder if it has no children

1 Answer 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 18 Feb 2014, 09:45 AM
Hi, Is this possible?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 20 Feb 2014, 08:55 AM
Hello Tim,

It is possible, you can create a boolean field as part of your ViewModel which is set to false if there are no children. And you can then configure your TreeView model to use that field for the HasChildren option.

e.g.

@(Html.Kendo()
        .TreeView()
        .Name("tv")
        .DataSource(ds=>ds.Model(m=>
            m.HasChildren("theNameOfTheField")))
)


Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Tim
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or