Using Syncfusion 20.1.0.55
I have a page with a sfSchedule on it. If I navigated to the page and navigate to another page before the Scheduler has completed rendering then I get a NullReferenceException with the following stack trace.
If I wait for it to complete its renders and then move off to another page then there is no error.
Exception
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Schedule.Internal.EventBase`1.SetEventsData(IEnumerable`1 resultData)
at Syncfusion.Blazor.Schedule.Internal.MonthView`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.
at System.Threading.Tasks.Task.<>c.
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)
-----------------------------------------------------------------------------------------------------------
Code
-------------------------------------------------------------------------------------------------------
<div class="row pt-4">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box-container p-2">
<h5>@Title</h5>
<div id = "ControlRegion">
<SfSchedule TValue="IModel" ID="schedule" EnablePersistence="false" AllowDragAndDrop="false" ShowQuickInfo="true" EnableAutoRowHeight="false" Height="650px" @bind-SelectedDate="@CurrentDate" @bind-CurrentView="@CurrentView">
<ScheduleEventSettings DataSource="@DataSource" EnableTooltip="true"></ScheduleEventSettings>
<ScheduleViews>
<ScheduleView Option="View.Day"></ScheduleView>
<ScheduleView Option="View.Week"></ScheduleView>
<ScheduleView Option="View.WorkWeek"></ScheduleView>
<ScheduleView Option="View.Month"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
</SfSchedule>
</div>
</div>
</div>
</div>
Hi David,
Greetings from Syncfusion support.
We have validated your reported query “Navigating away from a page with a sfSchedule on it before it finishes rendering throws an error” based on your shared details. We have resolved a similar issue in our latest Syncfusion package v20.2.40. Can you kindly update the Syncfusion package to the latest version v20.2.40 and let us know still you facing the same problem?
Regards,
Ravikumar Venkatesan
That looks like it resolved the issue. Thank you.
Hi David,
Thanks for the update.
We are happy that your reported issue was resolved in the latest version.
Regards,
Ravikumar Venkatesan