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

Scrolling with hidden columns produces error

2 Answers 43 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 22 Feb 2018, 06:11 PM

My DataGrid has hidden columns.  If I try to horizontally scroll to the end of the table before I "unhide" the columns, I get the following error.  Could someone please help?

{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.Measure()
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.SetHorizontalOffset(Double physicalOffset, Boolean updateUI, Boolean updateScrollViewer)
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.UpdateScrollOffsetOnRendering()
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.CompositionTarget_Rendering(Object sender, Object e)}
    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."
    Native View: To inspect the native object, enable native code debugging.
? e
{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.Measure()
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.SetHorizontalOffset(Double physicalOffset, Boolean updateUI, Boolean updateScrollViewer)
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.UpdateScrollOffsetOnRendering()
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.CompositionTarget_Rendering(Object sender, Object e)}
    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."

2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 27 Feb 2018, 07:46 AM
Hello Matthew,

With R1 2018 we have fixed an IndexOutOfRangeException in the DataGrid control when some of the columns are not visible and you try to scroll to some of it. If you are using an older version could you please, try to upgrade to our latest one and let us know if the issue still occurs? If the issue persists please, create a sample project that demonstrates it and send it back to us - thus we will be able to investigate it further and provide you with a prompt solution if possible.

Hope the provided information will be helpful for you.

Regards,
Nasko
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Matthew
Top achievements
Rank 1
answered on 01 Mar 2018, 05:16 PM
Thanks!  I downloaded the new version from NuGet and it seems to have resolved the issue.
Tags
DataGrid
Asked by
Matthew
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or