Hi Bulmaro,
We have prepared a sample to meet your requirements by
making the necessary changes in the referred sample. Kindly check the code
changes below,
[Query: 1 – Route generation]
[Index.razor]
@{
string path = "";
for (int i =
ParentIdArray.Length - 1; i >= 0; i--)
{
path += ParentTextArray[i];
if (i > 0)
{
path += "/";
}
}
}
<p>@path</p>
public void NodeSelected(NodeSelectEventArgs args)
{
List<string> IdList = new List<string>();
List<string> TextList = new List<string>();
IdList.Add(args.NodeData.Id);
TextList.Add(args.NodeData.Text);
…
}
|
[Query: 2 – Get the additional properties of nodes]
<SfTreeView TValue="MusicAlbum" AllowMultiSelection="true" @ref="tree" @bind-SelectedNodes="SelectedNodes">
<TreeViewEvents TValue="MusicAlbum" NodeSelected="NodeSelected"></TreeViewEvents>
</SfTreeView>
public void NodeSelected(NodeSelectEventArgs args)
{
…
var TreeData =
tree.GetTreeData();
}
|
We have attached the sample for your reference,
Sample: Attached as zip file.
Kindly try out the shared details and get back to us if you
need further assistance.
Regards,
Jafar
Attachment:
Blazor_TreeView_86a2a618.zip