We're using a standard RadTreeListView and want to avail of the virtualization feature so have left the EnableRowVirtualization to default to true. The control is bound to a CollectionViewSource (I've tried just binding to a standard collection but it makes no difference) It all behaves fine and displays the data correctly in the tree until we try to scroll vertically at which point it throws a null ref exception:
"System.NullReferenceException: Object reference not set to an instance of an object.\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.ReleaseContainersOutsideViewport(Rows rows, Int32 rowCount)"
The file version of the assembly we have is 2013.2.724.1050
If i hardcode the width and height of the control to a fixed value it behaves fine. I tired just binding the width and height to the parent but it doesn't work either. Doing the same from code behind using SizeChanged also made no difference.
If I set EnableRowVirtualization to false we get another null reference, this time straightaway on load from a different place:
"System.NullReferenceException: Object reference not set to an instance of an object.\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)"
Is this a known issue?
6 Answers, 1 is accepted
You can open a support ticket and attach the project there.
Regards,
Didie
Telerik
May I ask you to confirm the exact version you are using - is it the latest one?
If so, would you please try configuring RadTreeListView with GroupRenderMode="Nested"?
Regards,
Dimitrina
Telerik
Hi,
I am using version 2013.1.527.1050
I tried setting GroupRenderMode to Nested and it changed the error to the stack trace below.
In addition, the problem only happens when I set a RowStyle which includes a binding between the IsExpanded of the TreeListViewRow and the data item
Message: System.IndexOutOfRangeException: Index was outside the bounds of the array.
ב Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.RealizedItemBlock.ClearEntries(Int32 offset, Int32 count)
ב Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.RealizedItemBlock.CopyEntries(RealizedItemBlock src, Int32 offset, Int32 count, Int32 newOffset)
ב Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.MoveItems(ItemBlock block, Int32 offset, Int32 count, ItemBlock newBlock, Int32 newOffset, Int32 deltaCount)
ב Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Remove(GeneratorPosition position, Int32 count, Boolean isRecycling)
ב Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IRecyclingItemContainerGenerator.Recycle(GeneratorPosition position, Int32 count)
ב Telerik.Windows.Controls.GridVie
Thank you for sharing this additional information.
Would you please try using the approach suggested in the documentation on IsExpandedBinding and IsExpandableBinding instead of binding IsExpanded property of TreeListViewRow ?
Regards,
Dimitrina
Telerik