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

Sporadical NullReferenceException on RemoveItem from bound ObservableCollection

1 Answer 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kris
Top achievements
Rank 1
Kris asked on 08 Jan 2014, 05:49 PM
Hi,

We're experiencing a rather difficult to reproduce issue with the RadGridView.

One of our users is working on a Windows 8 machine with the latest version of Silverlight. When performing a drop action in our application 9/10 times he encounters the exception listed below.

The drop action is rather basic, this is the scenario:
  1. There's an ObservableCollection<T> bound (two-way) to the RadGridView.
  2. There's a button in each row that triggers a command.
  3. The command executes Remove(T) on the ObservableCollection<T>.
  4. Done.

[Arg_NullReferenceException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.20913.00&File=mscorlib.dll&Key=Arg_NullReferenceException
 
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.Collection_Clear[T](PresentationFrameworkCollection`1 collection)
   at System.Windows.PresentationFrameworkCollection`1.ClearImpl()
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.OnGeneratorItemsChanged(Object sender, ItemsChangedEventArgs args)
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Refresh()
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.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 Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChangedWithAdjustedArgs(NotifyCollectionChangedEventArgs originalArguments, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
   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.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)
   at OurApplication.UI.ViewModels.RequestVM.Drop()
   at Microsoft.Practices.Prism.Commands.DelegateCommand.<>c__DisplayClass6.<.ctor>b__2(Object o)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
  at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
   at System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand()
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)


We're still using version 2013.2.0724.1050 of the controls, however, as I mentioned reproducing the problem is next to impossible for us (the developers) so we see little point in upgrading to the latest version currently.

Has anyone ever came across this problem? Or has it maybe been fixed already in subsequent releases?

Br,
Kris

1 Answer, 1 is accepted

Sort by
0
Kris
Top achievements
Rank 1
answered on 10 Jan 2014, 09:50 AM
Hi,

I was misinformed regarding the OS of the user's workstation, it was W7 64-bits instead.

It seems this particular problem isn't tied to a specific version of Internet Explorer. Rather it's a combination of using Silverlight while the Tablet PC Input Service is running. Once you disable this particular service, the problems go away entirely. Which leads me to assume that it's an issue with Silverlight itself.

In case someone experiences a similar problem where the browser (IE) keeps crashing or SL keeps throwing exceptions just disable this service and you're good to go.


Br,
Kris
Tags
GridView
Asked by
Kris
Top achievements
Rank 1
Answers by
Kris
Top achievements
Rank 1
Share this question
or