It works properly in v19.1.7 and earlier but doesn't work in v19.1.8.
Razor<DxTreeView Data="@nodes"
TextExpression="@(dataItem => ((TestData)dataItem).Caption)"
NavigateUrlExpression="@(dataItem => ((TestData)dataItem).Link)"
ChildrenExpression="@(dataItem => ((TestData)dataItem).ChildNodes)"></DxTreeView>
@code {
string SelectedGroup = "none";
List<TestData> nodes;
protected override async Task OnInitializedAsync()
{
nodes = new List<TestData>();
for (int i = 0; i < 10; i++)
{
List<TestData> childNodes = new List<TestData>();
for (int j = 0; j < 3; j++)
{
TestData childNode = new TestData { Caption = "Child Caption " + i + "_" + j, Link = "https://devexpress.com" };
childNodes.Add(childNode);
}
TestData node = new TestData { Caption = "Caption " + i, ChildNodes = childNodes };
nodes.Add(node);
}
}
protected void SelectionChanged(TreeViewNodeEventArgs e)
{
SelectedGroup = e.NodeInfo.Text;
InvokeAsync(StateHasChanged);
}
public class TestData
{
public string Caption { get; set; }
public string Link { get; set; }
public List<TestData> ChildNodes { get; set; }
}
}