Is it possible to have the panelbar nesting be recursive? Let's say we are binding to a list of objects inside the model like this:
publicclassActivity
{
publicstringActivityId { get; set; }
publicstringDescription { get; set; }
publicList<Activity> Activities { get; set; }
}
1 Answer, 1 is accepted
0
Daniel
Telerik team
answered on 20 Sep 2013, 10:40 AM
Hello Carrie,
This is the default binding behavior when the child items type is the same. You should just specify the mapping for the type and how the children can be accessed:
@(Html.Kendo().PanelBar()
.Name("panelbar")
.BindTo(Model, mappings =>
{
mappings.For<Activity>(binding => binding
.ItemDataBound((item, activity) =>
{
item.Text = activity.Description;
})
.Children(activity => activity.Activities));
})
)
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!