I copied this example and got it working:
Can you tell me how to default my TreeList to have everything expanded when my page loads? It seems running the SetTreeListExpandedItems after loading my data does not expand everything automatically... which is confusing to me.
<TelerikCard>
<CardBody Class="gsi-padding-0">
<TelerikButton OnClick="@SetTreeListExpandedItems"
Class="gsi-width-100pct">
Expand/Collapse Groups
</TelerikButton>
</CardBody>
</TelerikCard>
<TelerikTreeList @ref=TreeListRef
Data="@Groups"
SelectedItems="@SelectedGroups"
IdField="@nameof(Gsi.Customer.Models.Group.Id)"
ParentIdField="@nameof(Gsi.Customer.Models.Group.ParentId)"
OnStateInit="((TreeListStateEventArgs<Gsi.Customer.Models.Group> args) => OnStateInitHandler(args))"
Pageable="false"
Sortable="false"
SelectionMode="TreeListSelectionMode.Single"
FilterMode="@TreeListFilterMode.FilterMenu"
SelectedItemsChanged="@((IEnumerable<Gsi.Customer.Models.Group> m) => OnGroupSelected(m))">
<TreeListColumns>
<TreeListColumn Field="Name" Title="Group Filter" Expandable="true">
<Template>
@{
var item = context as Gsi.Customer.Models.Group;
<img height="32" width="32" src="@item.ImageUrl" />
@item.Name
}
</Template>
</TreeListColumn>
</TreeListColumns>
</TelerikTreeList>