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

Object reference not set to an instance of an object.

3 Answers 224 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Wolfgang
Top achievements
Rank 1
Wolfgang asked on 11 Jan 2016, 02:35 PM

Hi,

We're using Visual Studio 2012 Update 5 and Telerik UI for WPF 2015.3.1104.45 version.

We have develop a custom gridview with the functionality of two wpf examples from your WPF controls examples. (GridView Control Panel and PersistenceFramework GridView Serialization) and somtimes we're getting this exception when we drag and drop a column to group field area.

Error: Object reference not set to an instance of an object.
Stacktrace:
   bei Telerik.Windows.Data.QueryableCollectionView.InternalIndexOf(Object item)
   bei Telerik.Windows.Data.QueryableCollectionView.TryRestorePreviousCurrency()
   bei Telerik.Windows.Data.QueryableCollectionView.InitializeCurrencyOnRefresh(CurrencyRefreshInfo currencyRefreshInfo)
   bei Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
   bei Telerik.Windows.Data.QueryableCollectionView.RefreshInternal()
   bei Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
   bei Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
   bei Telerik.Windows.Data.QueryableCollectionView.OnGroupDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   bei Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   bei System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
   bei System.Collections.ObjectModel.Collection`1.System.Collections.IList.Insert(Int32 index, Object value)
   bei Telerik.Windows.Data.CollectionHelper.Insert(IList target, IEnumerable newItems, Int32 startingIndex, IEqualityComparer itemComparer)
   bei Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
   bei Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
   bei Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   bei System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   bei Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   bei System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.PerformGrouping(IGroupDescriptor descriptor, Nullable`1 insertionIndex, GroupingEventAction action)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass6c.<RequestGrouping>b__6b()
   bei Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.RequestGrouping(IGroupDescriptor descriptor, Nullable`1 insertionIndex, GroupingEventAction action)
   bei Telerik.Windows.Controls.GridView.DragDropController.OnGroupPanelDrop(Object sender, DragEventArgs e)
   bei Telerik.Windows.DragDrop.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   bei Telerik.Windows.DragDrop.IInputElementExtensions.RaiseEvent(DependencyObject d, RoutedEventArgs routedEventArgs)
   bei Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnDragEventHandler(Object sender, DragEventArgs e)
   bei Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnDrop(Object sender, DragEventArgs e)
   bei System.Windows.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   bei System.Windows.OleDropTarget.RaiseDragEvent(RoutedEvent dragEvent, Int32 dragDropKeyStates, Int32& effects, DependencyObject target, Point targetPoint)
   bei System.Windows.OleDropTarget.MS.Win32.UnsafeNativeMethods.IOleDropTarget.OleDrop(Object data, Int32 dragDropKeyStates, Int64 point, Int32& effects)
   bei MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   bei System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   bei System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects)
   bei System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
   bei Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects, DragDropKeyStates initialKeyState, Object dragVisual, Point relativeStartPoint, Point dragVisualOffset)
   bei Telerik.Windows.DragDrop.DragInitializer.StartDrag()
   bei Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
   bei Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(Object sender, MouseEventArgs e)
   bei System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   bei System.Windows.Input.InputManager.ProcessStagingArea()
   bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)
   bei System.Windows.Application.Run(Window window)
   bei System.Windows.Application.Run()
   bei MetaxLvs.App.Main() in c:\Users\M5300\Documents\Visual Studio 2012\Projects\Metax\Metax-ERP\Metax-LVS\obj\x86\Debug\App.g.cs:Zeile 0.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Jan 2016, 09:57 AM
Hi Wolfgang,

Thank you for the Stacktrace provided.

Based on it I managed to find a possible cause for this exception. However, would it be possible for you to open a new support ticket and provide additional information in it concerning the exact assemblies that you are using, so I can prepare a custom build with the fix for you? It would also be quite useful, if you manage to reproduce the exception in a sample project and send it as an attachment in the ticket.

All the best,
Stefan X1
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Pavel
Top achievements
Rank 1
answered on 19 Jan 2016, 10:57 AM
We face the same problem. I already created a support ticket with the sample code (Crash with Object reference not set to an instance of an object)
0
Stefan
Telerik team
answered on 21 Jan 2016, 04:46 PM
Hello Pavel,

As already replied in the support thread you opened regarding this exception, the fix for this issue will be available in our next internal build on Monday.

All the best,
Stefan X1
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Wolfgang
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or