TreeView index negative number error

Hi there,

I am having an issue with the Blazor TreeView component in my Blazor Server app. It works fine when expanding/collapsing nodes initially, but if I expand and close the same node twice (two separate opens and closes) I get this error:

System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'index')
at System.Collections.Generic.List`1.RemoveRange(Int32 index, Int32 count)
at Radzen.Blazor.RadzenTree.RemoveFromCurrentItems(Int32 index, Int32 count)
at Radzen.Blazor.RadzenTreeItem.Toggle()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

I am not sure what is happening any any help would be greatly appreciated!

Make sure you are using the latest Radzen.Blazor.

1 Like

Hi,

How to update the components to the latest?

Thanks.

Ah I see it was a known issue that has been fixed in a previous release. Thank you

Simply use the latest similar to our demos: