Sidbar System.ArgumentOutOfRangeException

Hi,

After updating to the latest version, the Sidebar component generates the following error. Can you help us resolve this problem?

Image_5138_1722958551299


System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

   at Syncfusion.Blazor.Navigations.SfContextMenu`1.OnAfterRenderAsync(Boolean firstRender)

Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'uxJi5296k_X9AjjbOw4jJ7oLqARz1-jqFowZNxH1SR0'.


System.AggregateException: One or more errors occurred. (Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index'))

 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

   at Syncfusion.Blazor.Navigations.SfContextMenu`1.OnAfterRenderAsync(Boolean firstRender)

   --- End of inner exception stack trace ---

[2024-08-06T15:08:56.404Z] Error: System.AggregateException: One or more errors occurred. (Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index'))

 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

   at Syncfusion.Blazor.Navigations.SfContextMenu`1.OnAfterRenderAsync(Boolean firstRender)


Regards,

Zouhaier B


1 Reply

LD LeoLavanya Dhanaraj Syncfusion Team August 9, 2024 08:04 AM UTC

Hi Zouhaier,


Greetings from Syncfusion support.


From the shared details, we understand that you are experiencing an issue (System.ArgumentOutOfRangeException) with the SfContextMenu while integrating the Menu component inside the Sidebar. We have prepared and validated the mentioned issue in the Sidebar with the Menu component. However, we were unable to reproduce the issue on our end. For your reference, we have included the validated sample.


For further issue validation, please share the following details to help us validate and provide a suitable solution:


- Share all code snippets related to the Menu component.

- Share a video demonstrating the issue along with the steps to replicate it on our end.

- Additionally, please let us know if any custom code is used on your end related to the Menu component.

Note : The error System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') occurs, when attempt to access an element of a collection (like an array, list, or other indexed data structure) using an index that is either negative or greater than or equal to the number of elements in the collection.


Regards,

Leo Lavanya Dhanaraj


Attachment: BlazorApp_Sidebar_c6f6b014.zip

Loader.
Up arrow icon