I followed this Recursive Hierarchical Joins in C# and LINQ post to implement recursive join extension to show a tree view data in my application. As i have 15000 tree nodes, the jQuery DynaTree at client side preparation takes lot of time (50 Secs) in buggy browser I.E 7&8
To avoid this i decided to load only one level initially, then load other children on demand (Lazy Loading).
But i could not see the effect in setting depth in recursive join. Even i specify, it prepare all nodes.
public static List<DynaTreeNode> GenerateTreeByDepth(List<NodeDTO> nodeList,
int deepLevel)
{
StringBuilder hirTree = new StringBuilder();
List<DynaTreeNode> tree = new List<DynaTreeNode>();
IEnumerable<DynaTreeNode> nodes = nodeList.RecursiveJoin
(element => element.DataPointSK,element => element.DataPointSKParent,
(NodeDTO element, int index, int depth,IEnumerable<DynaTreeNode> childNodes) =>
new DynaTreeNode()
{
title = element.DataPoint,
key = element.DataPointSK.ToString(),
children = childNodes.ToList(),
select = element.selected,
expand = element.selected,
Depth = deepLevel
});
tree = nodes.ToList();
return tree;
}
I tried setting depth
Depth = deepLevel
But no use. What could be the issue? How can i do this?