I have a problem I can't understand. I can run sample code in Vs2019 and the treeviews act normally , expanding and contracting and firing Click events. When I cut and paste the same code into VS2022 the treeview will display nodes but will not act dynamically.
I've tried various solutions but am at my wits end.
Thanks
Simon
@using Syncfusion.Blazor.Lists
@using Syncfusion.Blazor.Navigations
<div id="treeparent">
<SfTreeView TValue="MailItem" @ref="tree2">
<TreeViewEvents TValue="MailItem" NodeSelected="nodeSelect"></TreeViewEvents>
<TreeViewFieldsSettings TValue="MailItem" Id="Id" DataSource="@MyFolder" Text="FolderName" ParentID="ParentId" HasChildren="HasSubFolders" Expanded="Expanded"></TreeViewFieldsSettings>
</SfTreeView>
</div>
@code {
public class MailItem
{
public string Id { get; set; }
public string ParentId { get; set; }
public string FolderName { get; set; }
public bool Expanded { get; set; }
public bool HasSubFolders { get; set; }
}
List<MailItem> MyFolder = new List<MailItem>();
SfTreeView<MailItem> tree2;
// usual OnInitialised and tree items
public void nodeSelect(NodeSelectEventArgs e)
{
var target = e.NodeData.Id;
}
Nodes do not expand nor collapse and nodeSelect does not fire