1

Closed

TreeView recursive data binding

description

It looks like that there is an error for the situation when we map same type to its own children.
 
For example, for type of sort :
public class Category
{
string Name;
Category parent;
IList<Category> Children;
}
when we map
 
mappings.For<Category>(x => x.ItemDataBound((control, item) =>
{
control.Text = item.Name;
}).Children(category => category.Children));
 
we get StackOverflowException, even though collection of categories itself may be perfectly valid tree (for example, even when Children collection for each passed element is empty).
 
For different types, mapping works well, but not for the same type as it looks like.
Closed Aug 26, 2010 at 12:25 PM by gyoshev
This scenario is supported. You can see it working in the <a href="http://demos.telerik.com/aspnet-mvc/treeview/draganddrop">Drag&Drop online demo</a>.

comments

gyoshev wrote May 25, 2010 at 8:04 AM

This scenario is supported. You can see it working in the <a href="http://demos.telerik.com/aspnet-mvc/treeview/draganddrop">Drag&Drop online demo</a>.