System.ArgumentOutOfRangeException while changing day to week and so on

Hi, I'm totally stuck and I guess need some help,

I'm trying to add a resource to a perfectly working scheduler. When the page loads on "Day" view, it's fine. When I change date or click any other view except "Agenda", I get the following error;

------------------------

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

   at Syncfusion.Blazor.Schedule.Internal.VerticalEventTable`1.FilterDayCollection(List`1 eventCollection)

   at Syncfusion.Blazor.Schedule.Internal.VerticalEventTable`1.FilterCollection(List`1 eventCollection)

   at Syncfusion.Blazor.Schedule.Internal.VerticalEventTable`1.CallStateHasChanged(List`1 eventCollection, List`1 cellAttributes, String eventWrapperClass)

   at Syncfusion.Blazor.Schedule.Internal.VerticalView`1.DataReady(IEnumerable`1 result, Nullable`1 date)

   at Syncfusion.Blazor.Schedule.Internal.EventBase`1.DataManagerSuccess(IEnumerable`1 result)

   at Syncfusion.Blazor.Schedule.Internal.EventBase`1.RefreshDataManager()

   at Syncfusion.Blazor.Schedule.Internal.EventBase`1.RefreshDataManager()

   at Syncfusion.Blazor.Schedule.SfSchedule`1.RefreshEventsAsync()

   at Syncfusion.Blazor.Schedule.SfSchedule`1.RefreshEvents()

   at Syncfusion.Blazor.Schedule.SfSchedule`1.<OnPropertyChangeHandler>b__207_0()

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

------------------------

1.png


What am I missing here?

Thanks in ad


2 Replies

MU Mustafa April 9, 2022 09:51 PM UTC

Nevermind, I found the problem. I was calling OnInitializedAsync after OnActionCompletedAsync and this was causing all the mess.



VM Vengatesh Maniraj Syncfusion Team April 11, 2022 10:20 AM UTC

Hi Mustafa,


Thanks for the update.

We are happy that you have found the cause.

Please get back to us if you need any further assistance.


Regards,

Vengatesh 


Loader.
Up arrow icon