Setting ItemsSource to null causing a null reference exception with 2011 Q2 SP1

4 posts, 0 answers
  1. Prasanthi
    Prasanthi avatar
    2 posts
    Member since:
    May 2011

    Posted 29 Sep 2011 Link to this post

    Hi,

    We have upgarded to the 2011 Q2 SP1 and all of a sudden, we starting experiencing a null reference exception when we try to set the itemssource to null. This happens only if we sort the grid on any column and then try to set the itemsssource to null.
    Is this a known issue in this release or Did we miss anything?

    I would appreciate, if you can help us on this.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Sep 2011 Link to this post

    Hi,

     I've tried this however I was unable to reproduce such exception. Can you post the stack trace?

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Michael Evans
    Michael Evans avatar
    31 posts
    Member since:
    Mar 2010

    Posted 25 Oct 2011 Link to this post

    I'm getting the same issue.  Here is my stack trace:

    {System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.Windows.Data.DataItemCollection.<SetItemsSource>b__3(NotifyCollectionChangedEventArgs c)
       at Telerik.Windows.Data.DataItemCollection.<>c__DisplayClass18.<BindCollections>b__15(NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.ComponentModel.SortDescriptionCollection.OnCollectionChanged(NotifyCollectionChangedAction action)
       at System.ComponentModel.SortDescriptionCollection.ClearItems()
       at System.Collections.ObjectModel.Collection`1.Clear()
       at Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target, Func`2 itemConverter)
       at Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target)
       at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
       at Telerik.Windows.Data.RadObservableCollection`1.ClearItems()
       at Telerik.Windows.Data.ObservableItemCollection`1.ClearItems()
       at System.Collections.ObjectModel.Collection`1.Clear()
       at Telerik.Windows.Data.DataItemCollection.ClearLocalDescriptors()
       at Telerik.Windows.Data.DataItemCollection.set_CollectionView(QueryableCollectionView value)
       at Telerik.Windows.Data.DataItemCollection.ClearItemsSource()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass18.<Bind>b__17()
       at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsSourceChanged(Object oldValue, Object newValue)
       at Telerik.Windows.Controls.DataControl.OnItemsSourcePropertyChanged(DependencyObject origin, DependencyPropertyChangedEventArgs args)
       at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(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.DataControl.set_ItemsSource(Object value)
       at EclipsXPIDS.EmergencyMessaging.DevicesLoaded(LoadOperation`1 lo)
       at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass13`1.<Load>b__11(LoadOperation lo)
       at System.ServiceModel.DomainServices.Client.LoadOperation.<>c__DisplayClass4`1.<Create>b__0(LoadOperation`1 arg)
       at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
       at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Object result)
       at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(DomainClientResult result)
       at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
       at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Load>b__17(Object )}
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 26 Oct 2011 Link to this post

    Hello,

     Please open support ticket and send us an example project where we can replicate and debug this. 

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top