Completed
Last Updated: 16 Oct 2018 07:09 by urja
Jeff
Created on: 24 Aug 2017 16:19
Category: UI for UWP
Type: Bug Report
0
DataGrid: IndexOutOfRangeException is thrown while scrolling
I have a radgrid and when I scroll down it throws this error, but I'm not sure where the error is coming from or how I can help resolve it.

This is a UWP app and I'm debugging in VS 2017 15.3 on windows 10 creators edition.

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 index, Boolean approximate)
   at Telerik.Data.Core.Layouts.CompactLayout.UpdateAverageLength(Int32 startIndex, Int32 endIndex)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.MeasureVertically(RadSize availableSize, Double offset, Double bufferScale)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.OnMeasure(RadSize availableSize, Double offset, Int32 frozenEleme
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
5 comments
urja
Posted on: 06 Sep 2018 12:13
I also have a similar issue. When RadDataGrid is scrolled to bottom it throws this exception. 

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 index, Boolean approximate)
   at Telerik.Data.Core.Layouts.CompactLayout.UpdateAverageLength(Int32 startIndex, Int32 endIndex)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.MeasureVertically(RadSize availableSize, Double offset, Double bufferScale)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.OnMeasure(RadSize availableSize, Double offset, Int32 frozenElement

Its been a year of this post, and yet theres no solution Telerik have found yet and neither responded to this.
Long
Posted on: 30 Aug 2018 07:15
I also had a similar error. When the scroll of telerikGrid: RadDataGrid rolls to the last line, then I use a new action to reload the list on the telerikGrid: RadDataGrid has an exception error.

system.indexoutofrangeexception: index was outside the bounds of the array. at telerik.ui.xaml.controls.grid.indexstorage.valueforindex(int32 index, boolean approximate)

I suppose, Telerik was unable to fix this. There are many people who make this mistake, but Telerik does not have a positive response to this problem.
Matthew
Posted on: 21 Feb 2018 22:03
For me, this seems to be caused by hidden columns.  If I try to scroll before "unhiding" them, I get the error.  If I do unhide them, and then hide again, scrolling works fine.
Matthew
Posted on: 21 Feb 2018 21:26
I'm having a similar issue.  Horizontal scrolling produces an out of index error.  Please help, Telerik.

Here is the error message:
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
    Exception: {System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 index, Boolean approximate)
   at Telerik.UI.Xaml.Controls.Grid.CellsController`1.UpdateSlotWidth(Int32 cellSlot, Double cellWidth)
   at Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.GenerateCellsForLine(Int32 slot, Double largestLength, T lastElement)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.GenerateContainer(IList`1 itemInfos)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.MeasureForward(MeasureContext& context)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.MeasureHorizontally(RadSize availableSize, Double offset, Int32 frozenElementsCount)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`2.OnMeasure(RadSize availableSize, Double offset, Int32 frozenElementsCount, Double verticalBufferScale)
   at Telerik.UI.Xaml.Controls.Grid.Model.GridModel.MeasureHeaderRow(RadSize newAvailableSize)
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.OnHeaderRowMeasure(RadSize newAvailableSize)
   at Telerik.UI.Xaml.Controls.Grid.Primitives.DataGridColumnHeaderPanel.MeasureOverride(Size availableSize)}
    Handled: false
    Message: "System.IndexOutOfRangeException: Index was outside the bounds of the array.\r\n   at Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 index, Boolean approximate)\r\n   at Telerik.UI.Xaml.Controls.Grid.CellsController`1.UpdateSlotWidth(Int32 cellSlot, Double cellWidth)\r\n   at Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)\r\n   at Telerik.UI.Xaml.Controls.Grid."
 
Jeff
Posted on: 24 Aug 2017 17:47
I found a similar issue from over a year ago but it doesn't look like it was resolved....
http://www.telerik.com/forums/raddatagrid-indexoutofrange-issue#_lQeZ7aeWUa3JMabyRAjkQ