How can I pass the recursive list to MVC3ControlsToolkit TreeView? I’ve found lots of example defining the items and sub-items manually but I need to bind it to the model. My model looks like this:
public class TreeNode
{
public TreeNode()
{
child = new HashSet<TreeNode>();
}
public int id { get; set; }
public string name { get; set; }
public ICollection<TreeNode> child { get; set; }
}
I’ve found the answer. Just needed to pass the IList containing recursive list instead of Icollection. Thanks to frankabbruzzese!!