Blazor RadzenTreeLevel Initial Level with NO children

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

item 1 ^ (has children)
Item 2 ^ (has children)
item 3 (no children)
item 4 (no children)
item 5 ^ (has children)

Tree looks like this
tree is a list of items I have from an api call

<RadzenTree Style="width: 100%; height: 95%" 
     Data="@tree.Where(a => a.Level == 0)" Expand="@LoadPath">
    <RadzenTreeLevel Text="@GetTextForNode" />
</RadzenTree>

Note that removed the '<' from the start of the controls above so it renders :slight_smile:

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....

Ok finally figured out how to do this - here was the initial creation of the tree

<RadzenTree Style="width: 100%; height: 95%" Data="@treeList" Expand="@LoadPath">
            <RadzenTreeLevel Text="@GetTextForNode" Template="@VaultItemTemplate" />
    </RadzenTree>

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..

<RadzenTree Style="width: 100%; height: 95%" Data="@treeList" Expand="@LoadPath">
            <RadzenTreeLevel Text="@GetTextForNode" Template="@VaultItemTemplate" HasChildren="@((item) => DoesChildHaveChildren(item))" />
    </RadzenTree>

And now I get the tree rendered with some items WITH children and some without....