This question is locked. New answers and comments are not allowed.
I'm getting this error when trying to bind the AppoinmentSource:
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
StackTrace:
at Telerik.Windows.Controls.ScheduleView.AppointmentExtensions.IsRecurring(IAppointment appointment)
at Telerik.Windows.Controls.ScheduleView.AppointmentExtensions.GetOccurrences(IAppointment appointment, DateTime from, DateTime to)
at Telerik.Windows.Controls.DateGroupDescription.GroupNameFromItem(Object item, Int32 level, CultureInfo culture)
at MS.Internal.CollectionViewGroupRoot.AddToSubgroups(Object item, CollectionViewGroupInternal group, Int32 level, Boolean loading)
at System.Windows.Data.ListCollectionView.PrepareGroups()
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.Refresh()
at System.Windows.Data.CollectionView.EndDefer()
at System.Windows.Data.CollectionView.DeferHelper.Dispose()
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.OnAppointmentSourceChanged(IEnumerable oldValue, IEnumerable newValue)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateScheduleViewOnAppointmentSourceChanged(IEnumerable oldValue, IEnumerable newValue)
at Telerik.Windows.Controls.ScheduleViewBase.OnAppointmentsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.ScheduleViewBase.set_AppointmentsSource(IEnumerable value)
at Pars.Web.SilverLight.Calendar.MainPage.Service_GetTasksCompleted(Object sender, GetTasksCompletedEventArgs e)
at Pars.Web.SilverLight.Calendar.TaskCalendarReference.TaskCalendarServiceClient.OnGetTasksCompleted(Object state)
InnerException:
I set the AppointmentSource as follows:
What am I doing wrong?
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
StackTrace:
at Telerik.Windows.Controls.ScheduleView.AppointmentExtensions.IsRecurring(IAppointment appointment)
at Telerik.Windows.Controls.ScheduleView.AppointmentExtensions.GetOccurrences(IAppointment appointment, DateTime from, DateTime to)
at Telerik.Windows.Controls.DateGroupDescription.GroupNameFromItem(Object item, Int32 level, CultureInfo culture)
at MS.Internal.CollectionViewGroupRoot.AddToSubgroups(Object item, CollectionViewGroupInternal group, Int32 level, Boolean loading)
at System.Windows.Data.ListCollectionView.PrepareGroups()
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.Refresh()
at System.Windows.Data.CollectionView.EndDefer()
at System.Windows.Data.CollectionView.DeferHelper.Dispose()
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.OnAppointmentSourceChanged(IEnumerable oldValue, IEnumerable newValue)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateScheduleViewOnAppointmentSourceChanged(IEnumerable oldValue, IEnumerable newValue)
at Telerik.Windows.Controls.ScheduleViewBase.OnAppointmentsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.ScheduleViewBase.set_AppointmentsSource(IEnumerable value)
at Pars.Web.SilverLight.Calendar.MainPage.Service_GetTasksCompleted(Object sender, GetTasksCompletedEventArgs e)
at Pars.Web.SilverLight.Calendar.TaskCalendarReference.TaskCalendarServiceClient.OnGetTasksCompleted(Object state)
InnerException:
I set the AppointmentSource as follows:
Dim appts As New ObservableCollection(Of Appointment)For Each t In tasks appts.Add(MakeAppt(t))NextRadScheduleView1.AppointmentsSource = appts.....Private Function MakeAppt(task As Task) As Appointment Dim a As New Appointment With { .Body = task.TaskNarrative, .Start = task.InitiatedDate, .End = task.CompletionDueDate, .Subject = task.TaskNarrative, .IsAllDayEvent = False }Return (a)End FunctionWhat am I doing wrong?