Building PanelBar Children Rescursively and Binding to Model

2 posts, 0 answers
  1. Carrie
    Carrie avatar
    27 posts
    Member since:
    Aug 2013

    Posted 18 Sep 2013 Link to this post


    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:
    public class Activity
           public string ActivityId { get; set; }
           public string Description { get; set; }
           public List<Activity> Activities { get; set; }       
  2. Daniel
    Daniel avatar
    2177 posts

    Posted 20 Sep 2013 Link to this post

    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:

          .BindTo(Model, mappings =>
               mappings.For<Activity>(binding => binding
                   .ItemDataBound((item, activity) =>
                            item.Text = activity.Description;
                   .Children(activity => activity.Activities));
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top