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

Occasional ArgumentOutOfRangeException With 2018.2.619

10 Answers 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
intellitechcorporation
Top achievements
Rank 1
intellitechcorporation asked on 10 Aug 2018, 04:55 PM

Telerik Support,

I hate to just post an exception stack trace without being able to provide many more details, but unfortunately I'm not getting any helpful information out of the stack trace to help me track this down.

System.ArgumentOutOfRangeException: Index must be within the bounds of the List.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.Insert(Int32 index, T item)
   at Telerik.Windows.Data.KeyedCollection.Insert(Int32 index, Object value)
   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 COMPANYNAME.Data.APSSObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.SetItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value)
   at PRODUCTNAME.AsyncReturns.<>c__DisplayClass37_0.<INTERNALMETHOD>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)     

10 Answers, 1 is accepted

Sort by
0
intellitechcorporation
Top achievements
Rank 1
answered on 10 Aug 2018, 05:01 PM
Sorry, accidentally hit post when I meant to add more information.  It seems like this would be helpful in tracking this down, but unfortunately the method (METHODNAME) is happening way too early in the application lifetime compared to when the exception is actually happening.  I have a simple class that inherits from ObservableCollection to get PropertyChanged notifications when an item in the collection changes (I know Telerik has ObservableItemCollection, but I believe there were a few cases where this did not work for me).  Of course I am locking these collections wherever they are updated, the only difference seems to have been updating from R2 2018 to R2 2018 SP1.
0
intellitechcorporation
Top achievements
Rank 1
answered on 10 Aug 2018, 08:44 PM

If it's helpful, I have confirmed that downgrading to 2018.2.515 fixes the issue.  I tried upgrading to the internal build 2018.2.806 prior to that with no change.  It appears I have to manually sort a RadGridView, then update the collection by setting the index of the collection to the updated object to get the exception to trigger, which I have been doing since I first started using RadGridView (I believe it's required to get the item to move properly in the RadGridView while sorted).  I'm not sure it's 100% consistent.

example:

someObject.SomeProperty = "UpdatedValue";
lock(SomeCollection)
    SomeCollection[oIndex] = someObject;
0
intellitechcorporation
Top achievements
Rank 1
answered on 14 Aug 2018, 12:35 PM
Can I get some sort of indication this has at least been looked at by someone from Telerik/Progress?
0
Dilyan Traykov
Telerik team
answered on 15 Aug 2018, 08:41 AM
Hello Kyle,

Thank you for the provided stack trace and details.

Without being able to replicate the issue at my end, however, it is hard for me to suggest a possible cause and solution for it. Would it be possible for you to replicate it in a small sample project and send it over via a new support ticket? If that is not the case, please share more details on the exact setup at your end and the action steps that lead to the error so that I can get a better understanding and further assist you.

Thank you in advance for your cooperation on the matter. I look forward to your reply.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
intellitechcorporation
Top achievements
Rank 1
answered on 18 Aug 2018, 11:56 PM

Dilyan,

Thanks for getting back to me.  I think I have found it has to do with a FilterDescriptor I am using to dynamically hide items instead of removing them.  It may not be totally clear why I am doing this in this sample app, but the logic makes sense in my real app.  I'm totally open to the fact that I may be doing something wrong here, but I can't figure out what it is.

 

I'm not totally sure how to upload a sample app anymore, I think it used to be built into the forum system.  Let me know what the best way to get this to you would be.

0
intellitechcorporation
Top achievements
Rank 1
answered on 19 Aug 2018, 12:26 AM
I also discovered that the issue actually occurs when there is no sort on the RadGridView, contrary to my previous post.
0
Dilyan Traykov
Telerik team
answered on 20 Aug 2018, 09:50 AM
Hello Kyle,

As our forum system only allows the upload of image files, you will need to open a new support ticket from your Telerik account and attach the project there.

I will be awaiting your sample project.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
intellitechcorporation
Top achievements
Rank 1
answered on 20 Aug 2018, 10:16 AM

Dilyan,

Thank you, sample project posted with ticket number 1338701.

0
Dilyan Traykov
Telerik team
answered on 20 Aug 2018, 10:31 AM
Hello Kyle,

I can confirm that we received the ticket in our system and I was able to reproduce the issue at my end.

I will update you in the support thread once I have more information on its cause.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
intellitechcorporation
Top achievements
Rank 1
answered on 22 Aug 2018, 04:18 PM

In case anyone runs into this issue and finds this thread, this is a confirmed bug with a bug report.

https://feedback.telerik.com/Project/143/Feedback/Details/255635-gridview-argumentoutofrangeexception-is-thrown-when-performing-a-collectionchang

Tags
GridView
Asked by
intellitechcorporation
Top achievements
Rank 1
Answers by
intellitechcorporation
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or