Completed
Last Updated: 15 Nov 2024 13:24 by ADMIN
Release 2024 Q4 (Nov)
Andreas
Created on: 12 Aug 2024 10:37
Category: TreeView
Type: Bug Report
2
When loading children on demand, NullReferenceException is thrown if the TreeView is disposed while the children are still loading

We have the following scenario:

  • a dialog that contains a TreeView
  • the TreeView is not expanded, when the dialog is opened, only the root node is displayed
  • the children are loaded on demand, when the parent node is expanded
  • there is a public async Task LoadChildrenAsync() that loads the children from the source
  • the loading operation might take a few seconds

The problem is when you close the dialog before the loading is finished, a NullReferenceException occurs.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.Common.Trees.TelerikTreeDataSource.GetTreeItems(IEnumerable`1 data, Int32 level, String parentIndex)

0 comments