Hi,
In your latest trial available build, there exists a problem, here I describe:
I have a WCF service which I retreive data from and then fill the ObservableCollection with them, this collection is the one will be set to ItemsSource of the grid.
In the process of filling the ObservableCollection, first I call Clear() method and then add new data to it.
Now steps resaulting to the Exception:
1- Set data to ItemsSource of grid
2- In the grid scroll down (not necessary to the end)
3- Do something to force data update (Next page, Edit, ....)
4- Oops, the exception! (This exception as is clear in the following lines happens when I call .Clear() method of ObservableCollection
Note that I have resolved my problem by first assigning null to the grid ItemsSource, then updating ObservableCollection and then reasign the ObservableCollection to ItemsSource :D
here is the detailed exception:
System.NullReferenceException: Object reference not set to an instance of an object. |
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Decorator.ArrangeOverride(Size arrangeSize) |
at System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Page.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Page.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Page.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Page.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) |
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Decorator.ArrangeOverride(Size arrangeSize) |
at System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.Window.ArrangeOverride(Size arrangeBounds) |
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) |
at System.Windows.UIElement.Arrange(Rect finalRect) |
at System.Windows.ContextLayoutManager.UpdateLayout() |
at System.Windows.UIElement.UpdateLayout() |
at Telerik.Windows.Controls.GridView.GridViewDataControl.ItemsSourceChanged(Boolean sourceChanged) |
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsChanged(NotifyCollectionChangedEventArgs e) |
at Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) |
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) |
at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) |
at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) |
at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) |
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) |
at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) |
at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride() |
at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer() |
at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args) |
at Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) |
at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) |
at Telerik.Windows.Data.QueryableCollectionView.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.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) |
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems() |
at System.Collections.ObjectModel.Collection`1.Clear() |
at MAVO.Extension.LearningCenter.Client.Windows.Pages.LearningCenter.Shared.UserSearch.bw_UpdateSearch_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) |
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) |
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg) |
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) |
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |