This question is locked. New answers and comments are not allowed.
I'm trying to create a tree view bound to my model and display children recursively. However, I can only get the children to display one level down. Is there a built-in workaround? This seems like basic functionality, but I've been unable to get >1 level down to display. Am I missing something simple here? Thanks.
Class:
| public class person |
| { |
| public string name { get; set; } |
| public int age { get; set; } |
| public List<person> children { get; set; } |
| } |
View:
| <%= Html.Telerik().TreeView() |
| .Name("TreeView") |
| .BindTo(Model, mappings => mappings.For<person>(binding => binding |
| .ItemDataBound((item, person) => |
| { |
| item.Text = person.Name; |
| item.Value = person.Age.ToString(); |
| }) |
| .Children(person => person.children))) |
| %> |