I want to use the tree control to display details of a hierarchy - not ALL of the items will have children - even on the initial level so I want to show something like this
The Radzen forum accepts Markdown similar to Stackoverflow. You can use it to format code.
Also not sure what you are asking - there seems to be no question. Anyway I suggest you check both the online demo and help article of the tree. The example that data-binds to the file system has nodes that are have children and some that don't.
The problem with the demo is that the initial list has all items with children - it gets all directories - imagine if at the top level I want to display folders AND files - that would mean that the initial tree would have a number of items with children and a number without children.
The question is how to create the tree at the TOP level with items that have NO children....
In the LoadPath function I could take care of working out if children nodes should have their OWN children
... some items removed for easy reading
args.Children.Data = items;
args.Children.Text = GetTextForNode;
args.Children.HasChildren = (path) => DoesChildHaveChildren(path);
.... some items removed for easy reading
In other words I had a function called DoesChildHaveChildren which allowed me to work out whether new codes created during an expansion had their own children - so all I needed to do was to use the same function for the primary level of the tree - so I changed the initial definition of the code to be..