Holidays exception

Hi,

You have set binding property in the xaml, initialize the property in the viewmodel, have showholidays set to true (default gantt setting) and not add any days to the collection.

The error seems appear when i unloaded tha gantt control.

Here below the stack strace 

System.NullReferenceException
  HResult=0x80004003
  Message=Riferimento a un oggetto non impostato su un'istanza di oggetto.
  Source=Syncfusion.Gantt.Wpf
  StackTrace:
   at Syncfusion.Windows.Controls.Gantt.DateTimeUtility.GetHolidays(GanttHolidayCollection ganttHolidays)
   at Syncfusion.Windows.Controls.Gantt.GanttControl.OnHolidaysChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
   at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

If i not initialize the collection i don't have any erroe, but collection initialize with no days is not accepted.

Best regards
Gian Piero Truccolo

1 Reply 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team June 7, 2021 09:38 AM UTC

Hi Gian Piero Truccolo, 
  
Greetings from Syncfusion.  
 
We have prepared a simple sample with the provided details and checked the reported crash. But we afraid that, we are not able to reproduce the reported issue in our side. Can you please check with the sample in the following location? If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to give better solution in this. 


Regards, 
Ramya S. 


Marked as answer
Loader.
Up arrow icon