GetVisibleAppointments exception

Hi,

I am getting below exception sometimes in logs. I am not able to understand why it might happen. Do you have any clue what might cause exception below? Am I passing some parameters missing to update SfSchedule?
thanks for your help,
Emil 

System.InvalidOperationExceptionmVisibleDate count can't be zero

Raw
  at Com.Syncfusion.Schedule.DataModelHelper.GetVisibleAppointments (Com.Syncfusion.Schedule.SfSchedule sfSchedule, System.Collections.ObjectModel.ObservableCollection`1[T] mVisibleDate) [0x00009] in <2efcc95ba22447fca8f6b25a5a530219>:0 
  at Com.Syncfusion.Schedule.SfSchedule.updateAppointment () [0x0001e] in <2efcc95ba22447fca8f6b25a5a530219>:0 
  at Com.Syncfusion.Schedule.SfSchedule.OnAppointmentsChanged (Com.Syncfusion.Schedule.ScheduleAppointmentCollection oldValue, Com.Syncfusion.Schedule.ScheduleAppointmentCollection newValue) [0x00025] in <2efcc95ba22447fca8f6b25a5a530219>:0 
  at Com.Syncfusion.Schedule.SfSchedule.set_Appointments (Com.Syncfusion.Schedule.ScheduleAppointmentCollection value) [0x00017] in <2efcc95ba22447fca8f6b25a5a530219>:0 
  at Syncfusion.SfSchedule.XForms.Droid.SfScheduleMapping.OnSfSchedulePropertiesChanged (System.String propertyName, Syncfusion.SfSchedule.XForms.SfSchedule formSfSchedule, Com.Syncfusion.Schedule.SfSchedule nativeSchedule, Syncfusion.SfSchedule.XForms.Android.SfScheduleRenderer scheduleRenderer) [0x000e5] in <3dd819751dd6410c80ebb2d588074933>:0 
  at Syncfusion.SfSchedule.XForms.Android.SfScheduleRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00027] in <3dd819751dd6410c80ebb2d588074933>:0 
  at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x000fb] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in <1982f4f36e0b4e118327ea411be26e7b>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <5d7f425850ee4587a9a5eb913c266936>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <5d7f425850ee4587a9a5eb913c266936>:0 
  at (wrapper dynamic-method) System.Object:c22c810f-f125-4172-9b55-4db65f68e0df (intptr,intptr)

5 Replies

SG Swathi Gopal Syncfusion Team October 23, 2017 09:26 AM UTC

 
Hi Emil, 
  
Thanks for contacting Syncfusion Support. 
  
Based on the provided information with schedule appointments we are unable to reproduce the mentioned exception from our side. We have prepared the simple sample (included Schedule appointments to the view) in Schedule Xamarin. Please find the sample link, 
  
Sample link: Appointments_Schedule 

Since the shared information is not sufficient to reproduce the issue. Could you please elaborate your query with more details by modifying the provided sample with the issue reproducing scenario and its replication procedure. It will helpful for us to check on it and provide you the better solution at the earliest. 
 
Regards, 
Swathi G 



MI Michael December 14, 2019 11:04 PM UTC

Same happens randomly in my application

AppointmentEngine.GetVisibleAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] visibleDateRange, Com.Syncfusion.Schedule.ScheduleAppointmentCollection appointments, System.Boolean isTimelineView)
System.Exception: Sequence contains no elements

at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <715c2ff6913942e6aa8535593b3ef35a>:0
at Com.Syncfusion.Schedule.AppointmentEngine.GetVisibleAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] visibleDateRange, Com.Syncfusion.Schedule.ScheduleAppointmentCollection appointments, System.Boolean isTimelineView) [0x0000e] in <1632960beb1040918d6960183e449248>:0
at Com.Syncfusion.Schedule.SfSchedule+<>c__DisplayClass320_0.<UpdateVisibleAppointments>b__0 () [0x00077] in <1632960beb1040918d6960183e449248>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 \n  
at System.Threading.Tasks.Task.Execute () [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 \n
--- End of stack trace from previous location where exception was thrown ---\n  
at Com.Syncfusion.Schedule.SfSchedule+<UpdateVisibleAppointments>d__320.MoveNext () [0x00089] in <1632960beb1040918d6960183e449248>:0
--- End of stack trace from previous location where exception was thrown ---
at Com.Syncfusion.Schedule.SfSchedule+<UpdateAppointments>d__321.MoveNext () [0x00116] in <1632960beb1040918d6960183e449248>:0


IR Indumathi Ravichandran Syncfusion Team December 16, 2019 11:15 AM UTC

Hi Michael, 
 
Thank you for the update. 
 
We have checked the mentioned exception in latest Nuget version 17.3.0.34, and we are unbale to replicate any exception from our end. We have tested by adding the adding custom appointments and swipe the views, checked with all ScheduleView modes and it is working fine as expected. We have prepared the sample for the same. 
 
 
We have tested with Syncfusion update version 17.3.0.34 and Xamarin.Forms version 3.6.0.344457 in the Redmi Note 4 device. 
 
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 following details, 
 
·       Excpetion reproducing video (if possible) 
·       Syncfusion and Xamarin.Forms update version 
·       Replication procedure  
 
It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards, 
Indumathi R   



MI Michael December 18, 2019 08:17 PM UTC

I updated XF and the syncfusion components to the latest versions and will check if the problem will be still existing.


IR Indumathi Ravichandran Syncfusion Team December 19, 2019 06:12 AM UTC

Hi Michael, 
 
Thank you for the update. We will wait to hear from you after the investigation. 
 
Please get in touch with us if you would require any further assistance. 
 
Regards, 
Indumathi R 


Loader.
Up arrow icon