Exception: ArgumentOutOfRangeException in RadSparkline

2 posts, 0 answers
  1. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 13 Nov 2012 Link to this post

    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.
  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 19 Nov 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top