滚动带有隐藏列的 RadDataGrid 会抛出错误
Scrolling RadDataGrid with hidden columns throws error
我的 DataGrid 有隐藏的列。如果我尝试在 "unhide" 列之前水平滚动到 table 的末尾,我会收到以下错误。有人可以帮忙吗?
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
异常:{System.IndexOutOfRangeException:索引超出数组范围。
在 Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 索引,布尔值近似值)
在 Telerik.UI.Xaml.Controls.Grid.CellsController1.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 插槽,Double largestLength,T lastElement)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.GenerateContainer(IList
1 项信息)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context)
at Telerik.UI.Xaml.Controls.Grid.NodePool
2.MeasureHorizontally(RadSize availableSize,Double offset,Int32 frozenElementsCount)
在Telerik.UI.Xaml.Controls.Grid.NodePool2.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 在Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)\r\n 在Telerik.UI.Xaml.Controls.Grid。”
本机视图:要检查本机对象,请启用本机代码调试。
?电子
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
异常:{System.IndexOutOfRangeException:索引超出数组范围。
在 Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 索引,布尔值近似值)
在 Telerik.UI.Xaml.Controls.Grid.CellsController1.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 插槽,Double largestLength,T lastElement)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.GenerateContainer(IList
1 项信息)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context)
at Telerik.UI.Xaml.Controls.Grid.NodePool
2.MeasureHorizontally(RadSize availableSize,Double offset,Int32 frozenElementsCount)
在Telerik.UI.Xaml.Controls.Grid.NodePool2.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 在Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)\r\n 在Telerik.UI.Xaml.Controls.Grid.
这里是 XAML:
<tg:RadDataGrid>
<tg:RadDataGrid.Columns>
<tg:DataGridTextColumn PropertyName="Number"
Header="Number"
SizeMode="Auto"/>
<tg:DataGridTextColumn PropertyName="BaseText"
Header="Base Text"
SizeMode="Fixed"
Width="300"
IsVisible="{Binding IsChecked, ElementName=ShowBaseCheckbox,Mode=TwoWay}">
</tg:DataGridTextColumn>
</tg:RadDataGrid.Columns>
</tg:RadDataGrid>
Telerik 表示此问题已在最新更新中得到解决。我已经从 NuGet 下载了它,它似乎确实解决了问题。
我的 DataGrid 有隐藏的列。如果我尝试在 "unhide" 列之前水平滚动到 table 的末尾,我会收到以下错误。有人可以帮忙吗?
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
异常:{System.IndexOutOfRangeException:索引超出数组范围。
在 Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 索引,布尔值近似值)
在 Telerik.UI.Xaml.Controls.Grid.CellsController1.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 插槽,Double largestLength,T lastElement)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.GenerateContainer(IList
1 项信息)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context)
at Telerik.UI.Xaml.Controls.Grid.NodePool
2.MeasureHorizontally(RadSize availableSize,Double offset,Int32 frozenElementsCount)
在Telerik.UI.Xaml.Controls.Grid.NodePool2.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 在Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)\r\n 在Telerik.UI.Xaml.Controls.Grid。”
本机视图:要检查本机对象,请启用本机代码调试。
?电子
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
异常:{System.IndexOutOfRangeException:索引超出数组范围。
在 Telerik.UI.Xaml.Controls.Grid.IndexStorage.ValueForIndex(Int32 索引,布尔值近似值)
在 Telerik.UI.Xaml.Controls.Grid.CellsController1.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 插槽,Double largestLength,T lastElement)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.GenerateContainer(IList
1 项信息)
在 Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context)
at Telerik.UI.Xaml.Controls.Grid.NodePool
2.MeasureHorizontally(RadSize availableSize,Double offset,Int32 frozenElementsCount)
在Telerik.UI.Xaml.Controls.Grid.NodePool2.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 在Telerik.UI.Xaml.Controls.Grid.Model.GridModel.Telerik.UI.Xaml.Controls.Grid.ITable.GenerateCellsForColumn(Int32 columnSlot, Double largestColumnElementWidth, IItemInfoNode columnDecorator)\r\n 在Telerik.UI.Xaml.Controls.Grid.
这里是 XAML:
<tg:RadDataGrid>
<tg:RadDataGrid.Columns>
<tg:DataGridTextColumn PropertyName="Number"
Header="Number"
SizeMode="Auto"/>
<tg:DataGridTextColumn PropertyName="BaseText"
Header="Base Text"
SizeMode="Fixed"
Width="300"
IsVisible="{Binding IsChecked, ElementName=ShowBaseCheckbox,Mode=TwoWay}">
</tg:DataGridTextColumn>
</tg:RadDataGrid.Columns>
</tg:RadDataGrid>
Telerik 表示此问题已在最新更新中得到解决。我已经从 NuGet 下载了它,它似乎确实解决了问题。