We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SFSchedule crashes when the collection appointment collection is empty for today

It seems like a new problem or I haven't encountered it yet. 
When switching to the view I'm greeted with an exception...

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

10-22 15:11:26.840 I/MonoDroid( 6716): UNHANDLED EXCEPTION:
10-22 15:11:26.840 I/MonoDroid( 6716): System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
10-22 15:11:26.840 I/MonoDroid( 6716): Parameter name: index
10-22 15:11:26.840 I/MonoDroid( 6716):   at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <9356a4b185c848f09ae2606849b9c534>:0 
10-22 15:11:26.840 I/MonoDroid( 6716):   at System.Collections.ObjectModel.Collection`1[T].get_Item (System.Int32 index) [0x00000] in <9356a4b185c848f09ae2606849b9c534>:0 
10-22 15:11:26.840 I/MonoDroid( 6716):   at Com.Syncfusion.Schedule.SfSchedule.UpdateSelection (System.Boolean canOpenInline) [0x001b2] in <e49d37741c4b4047a92a0ddbad4877e5>:0 
10-22 15:11:26.840 I/MonoDroid( 6716):   at Com.Syncfusion.Schedule.SfSchedule.OnQueryAppointmentChangedEventArgs (Com.Syncfusion.Schedule.QueryAppointmentEventArgs args) [0x00028] in <e49d37741c4b4047a92a0ddbad4877e5>:0 
10-22 15:11:26.840 I/MonoDroid( 6716):   at Com.Syncfusion.Schedule.SfSchedule.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x001aa] in <e49d37741c4b4047a92a0ddbad4877e5>:0 
10-22 15:11:26.841 I/MonoDroid( 6716):   at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00009] in /Users/vsts/agent/2.155.1/work/1/s/src/Mono.Android/obj/Release/android-28/mcw/Android.Views.View.cs:16644 
10-22 15:11:26.841 I/MonoDroid( 6716):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.34(intptr,intptr,int,int)

2 Replies

MI Michael October 22, 2019 08:54 AM

here is my xaml and I'm starting the view in weekView Mode. MonthviewMode works

                            ScheduleView="{Binding ViewMode}" DataSource="{Binding Items}"
                            SelectedDate="{Binding SelectedDate, Mode=TwoWay}"
                            FirstDayOfWeek="2" VisibleDatesChangedCommand="{ Binding ScheduleVisibleDatesChanged }"
                            ShowAppointmentsInline="false" MonthInlineAppointmentTapped="Schedule_MonthInlineAppointmentTapped" 
                            ViewHeaderHeight="40" HeaderHeight="40"  >

                        FontSize="12"  />

                        DateFontSize="10" />

                                        WorkStartHour="{Binding CourseStartHour}"
                                        WorkEndHour="{Binding CourseEndHour}">



IR Indumathi Ravichandran Syncfusion Team October 23, 2019 04:22 AM

Hi Michael,    
Thank you for contacting Syncfusion support.   
We have checked the reported issue “System.ArgumentOutOfRangeException occurred while changing the ScheduleView in Schedule” and we are unable to reproduce the issue from our end. We checked by changing the ScheduleView dynamically and checked with CellTapped and MonthInlineAppointmentTapped events, it is working fine as expected. We have attached the tested sample and video for your reference.   
Please find the sample and video from below link.  
Tested Versions:   
·       Syncfusion update version   
·       Xamarin.Forms version   
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back with the below details.  
·       Device configuration details   
·       Issue reproducing video (if possible)   
·       Syncfusion and Xamarin.Forms update version   
It will be helpful for us to check on it and provide you the solution at the earliest.   
Indumathi R 

Live Chat Icon For mobile
Up arrow icon