使用隐藏列滚动RadDataGrid会引发错误

问题描述 投票:0回答:1

我的DataGrid有隐藏的列。如果我在“取消隐藏”列之前尝试水平滚动到表的末尾,则会出现以下错误。有人可以帮忙吗?

{Windows.UI.Xaml.UnhandledExceptionEventArgs}异常:{System.IndexOutOfRangeException:索引超出了数组的范围。在Telerik.UI的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.NodePool2.GenerateCellsForLine(Int32 slot,Double largestLength,T lastElement)。位于Telerik.UI.Xaml.Controls.Grid.NodePool2.GenerateContainer(IList1.UpdateSlotWidth(Int32 cellSlot)的Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context) at Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureHorizo​​ntally(RadSize availableSize,Double offset,Int32 frozenElementsCount)中的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.CellsController1 itemInfos) ,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。“本机视图:要检查本机对象,启用本机代码调试。?e {Windows.UI.Xaml.UnhandledExceptionEventArgs}异常:{System.IndexOutOfRangeException:索引超出了数组。在Telerik.UI.Xaml.Controls.G Telerik.UI.Xaml.Controls.Grid.NodePool1.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.NodePool1 itemInfos中的Telerik.UI.Xaml.Controls.Grid.CellsController2.GenerateContainer(IList2.GenerateCellsForLine(Int32 slot,Double largestLength,T lastElement)中的rid.IndexStorage.ValueForIndex(Int32索引,布尔近似)在Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureForward(MeasureContext& context) at Telerik.UI.Xaml.Controls.Grid.NodePool2.MeasureHorizo​​ntally(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.CellsController1.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在Telerik.UI.Xaml.Controls。网格“。

这是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>
uwp telerik-grid uwp-xaml
1个回答
0
投票

Telerik说这个问题已在最新的更新中得到解决。我从NuGet下载了它,它确实解决了问题。

© www.soinside.com 2019 - 2024. All rights reserved.