I am using a SfTreeView component, and the datasource is loaded OnInitializedAsync.
When the component displays, all the top-level nodes are selected (i.e. they all show with a blue background over the row) if I have checkboxes turned on.
e.g.
<SfTreeView @ref="tree" TValue="ClassificationDTO" AllowEditing="true" AllowDragAndDrop="true" ExpandOn="ExpandOnSettings.Click" AutoCheck="true" SortOrder="Syncfusion.Blazor.Navigations.SortOrder.None" FullRowSelect="true" ShowCheckBox="true" AllowMultiSelection="false">
<TreeViewFieldsSettings TValue="ClassificationDTO" @bind-DataSource="@classifications" Id="Id" Text="Name" ParentID="ParentId" HasChildren="HasChildren" IsChecked="Active" Selected="false" Expanded="true" />
<TreeViewEvents TValue="ClassificationDTO" NodeSelected="OnSelect" NodeClicked="NodeClicked" />
<SfContextMenu TValue="ContextMenuItem" @ref="menu" Target="#treeview">
<ContextMenuEvents TValue="ContextMenuItem" ItemSelected="MenuSelect" />
<ContextMenuItems>
<ContextMenuItem Text="Add" />
<ContextMenuItem Text="Edit" />
<ContextMenuItem Text="Delete" />
</ContextMenuItems>
</SfContextMenu>
</SfTreeView>
@code {
List<ClassificationDTO> classifications;
protected override async Task OnInitializedAsync()
{
classifications = await caseRepository.GetClassifications();
}
If I turn checkboxes off, the issue does not occur (however, I need them turned on). If I populate the DataSource synchronously, the issue does not occur (but I need to load the data from my WebAPI async).
Does anyone else have this issue, and a workaround?
(Just to clarify, the 'selection' I'm talking about is the selection of the entire row, like the node has been clicked on, not the selection via the checkbox)