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
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;
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
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.
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
Dilyan,
Thank you, sample project posted with ticket number 1338701.
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
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