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

Exception: ArgumentOutOfRangeException in RadSparkline

1 Answer 91 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 13 Nov 2012, 07:51 AM
I am binding a RadSparkline against an INotifyCollectionChanged object. This object is NOT an ObservableCollection<>. It is raising CollectionChanged, with Action: Add, with StartingIndex as -1. This should be allowed when the collection is unordered, as mine is. However, RadSparkline is throwing an exception:

ArgumentOutOfRangeException Index must be within the bounds of the List.
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.Insert(Int32 index, T item)
   at Telerik.Windows.Controls.ProjectedView`1.ObservableSourceListCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Common\DataProjection\ProjectedView.cs:line 179

I am going to solve this problem by making a temporary ObservableCollection, and adding new items to the end of it as they arrive. However, this should not be required.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 19 Nov 2012, 12:38 PM
Hello Jerome,

I was able to reproduce the problem and forwarded it to our developers. For the time being, as a workaround, you can raise the CollectionChanged event with Action: Add and StartingIntex: the length of the collection minus one.

I updated your Telerik points for bringing the problem to our attention.

Regards,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Sparkline
Asked by
Jerome
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or