This is a migrated thread and some comments may be shown as answers.

ScheduleView in RadTabControl throws error when tab re-activated

3 Answers 75 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
XamlmaX2
Top achievements
Rank 1
XamlmaX2 asked on 23 Mar 2011, 12:16 PM
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

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 23 Mar 2011, 01:33 PM
Hi Pete,

Can you help us reproduce this issue?
I've attach sample project with RadScheduleView in RadTabControl and bound ResourceTypeSource to ViewModel property (trying to simulate your case) but there is no exception.
Could send us your project so that we can reproduce this error or if not possible please modify the attached project so that it throw this exception?

All the best,
Hristo
the Telerik team
0
Nasir
Top achievements
Rank 1
answered on 31 Jul 2013, 01:39 PM
Hi,

I am having the same problem. I get this error when I set the AppointmentsSource to the ScheduleView, was this ever resolved?

Regards,

Nasir
0
Vladi
Telerik team
answered on 05 Aug 2013, 11:47 AM
Hello,

We are not aware of any issues concerning the previously mentioned exception that involves setting the AppointmentsSource.

As this thread is quite old could you open a support thread and in that thread send us a sample project that recreates the described issue. This way we will be able to observe it on our side and assist you any further.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ScheduleView
Asked by
XamlmaX2
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Nasir
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or