I have a ScheduleView on a RadTabControl. The first time I activate the tab with the scheduleview it displays correctly. If I switch to another tab and then switch back I get the following error:
"Cannot change ObservableCollection during a CollectionChanged or PropertyChanged event"
Stack Trace:
at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()
at Telerik.Windows.Controls.ResourceGroupDescription.CreateGroupNames(ScheduleViewBase scheduleView)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateGroupDescriptor(GroupDescription descriptor)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
at Telerik.Windows.Controls.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.ResetAppointmentsInGroups()
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.OnNotifyingDataSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager`1.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager`1.DeliverEvent(Object sender, EventArgs args)
at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.RefreshOrDefer()
at System.Windows.Data.ListCollectionView.OnGroupDescriptionChanged(Object sender, EventArgs e)
at MS.Internal.CollectionViewGroupRoot.OnGroupByChanged()
at MS.Internal.CollectionViewGroupInternal.OnGroupByChanged(Object sender, PropertyChangedEventArgs e)
at System.ComponentModel.GroupDescription.OnPropertyChanged(PropertyChangedEventArgs e)
at System.ComponentModel.GroupDescription.OnGroupNamesChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()
at Telerik.Windows.Controls.ResourceGroupDescription.CreateGroupNames(ScheduleViewBase scheduleView)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateGroupDescriptor(GroupDescription descriptor)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
at Telerik.Windows.Controls.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.OnResourceTypesSourcePropertyChanged(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.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.DataContextChangedEventHandler.Invoke(Object sender, DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
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.FrameworkElement.set_DataContext(Object value)
at Iris.ServiceNG.Silverlight.Views.ViewLocator.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertToTarget(Object value)
at System.Windows.Data.BindingExpression.GetValue(DependencyObject d, DependencyProperty dp)
at System.Windows.DependencyObject.EvaluateExpression(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry)
at System.Windows.DependencyObject.EvaluateBaseValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.EvaluateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, ValueOperation operation)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)
at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)
I am not hooking into any collectionchanged or propertychanged events myself and I am not reloading the data into datasources for the scheduleview. I am not running any code when the activetab changes to change the scheduleview either.
Please can you help?
Thanks
"Cannot change ObservableCollection during a CollectionChanged or PropertyChanged event"
Stack Trace:
at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()
at Telerik.Windows.Controls.ResourceGroupDescription.CreateGroupNames(ScheduleViewBase scheduleView)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateGroupDescriptor(GroupDescription descriptor)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
at Telerik.Windows.Controls.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.ResetAppointmentsInGroups()
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.OnNotifyingDataSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager`1.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager`1.DeliverEvent(Object sender, EventArgs args)
at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.RefreshOrDefer()
at System.Windows.Data.ListCollectionView.OnGroupDescriptionChanged(Object sender, EventArgs e)
at MS.Internal.CollectionViewGroupRoot.OnGroupByChanged()
at MS.Internal.CollectionViewGroupInternal.OnGroupByChanged(Object sender, PropertyChangedEventArgs e)
at System.ComponentModel.GroupDescription.OnPropertyChanged(PropertyChangedEventArgs e)
at System.ComponentModel.GroupDescription.OnGroupNamesChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()
at Telerik.Windows.Controls.ResourceGroupDescription.CreateGroupNames(ScheduleViewBase scheduleView)
at Telerik.Windows.Controls.ScheduleViewBase.UpdateGroupDescriptor(GroupDescription descriptor)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Telerik.Windows.Controls.CollectionExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
at Telerik.Windows.Controls.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items)
at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions, Predicate`1 filter)
at Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders()
at Telerik.Windows.Controls.ScheduleViewBase.OnResourceTypesSourcePropertyChanged(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.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.DataContextChangedEventHandler.Invoke(Object sender, DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
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.FrameworkElement.set_DataContext(Object value)
at Iris.ServiceNG.Silverlight.Views.ViewLocator.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertToTarget(Object value)
at System.Windows.Data.BindingExpression.GetValue(DependencyObject d, DependencyProperty dp)
at System.Windows.DependencyObject.EvaluateExpression(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry)
at System.Windows.DependencyObject.EvaluateBaseValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.EvaluateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, ValueOperation operation)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)
at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)
I am not hooking into any collectionchanged or propertychanged events myself and I am not reloading the data into datasources for the scheduleview. I am not running any code when the activetab changes to change the scheduleview either.
Please can you help?
Thanks