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

[Solved] leaf and node children

1 Answer 37 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
don
Top achievements
Rank 1
don asked on 13 Dec 2010, 05:23 AM
In my treeview I need to have children that are leaf nodes as well as children that are also containers.  At the top level is objects of class mContainer, which contains ALBUMS and ITEMS.  Albums contain ITEMS.  I can;t figure out the Model Binding syntax to make this work.  Do I need to have a single IEnumerable that holds both containers and nodes?

mContainer : tContainer{
IEnumerable<mAlbum> Albums;
}

mAlbum : tContainer {
}

mItem : tNode{
}

tContainer : tNode {
IEnumerable<mItem> Items;
}

tNode { string Name; }

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 13 Dec 2010, 09:11 AM
Hello don,

 
I am not exactly sure what you goal is, but you can check this online demo, which shows how to bind TreeView to model.

Best wishes,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
don
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or