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

NullReferenceException in TreeListView

6 Answers 72 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 21 May 2014, 10:24 AM
Hi,

          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

Sort by
0
Charlie
Top achievements
Rank 1
answered on 21 May 2014, 01:10 PM
I've was able to write a sample app to show this problem which I can share ( but not here because I'm not allowed to upload zips and its over 2MB )
0
Dimitrina
Telerik team
answered on 21 May 2014, 01:38 PM
Hello,

You can open a support ticket and attach the project there.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Amir
Top achievements
Rank 1
answered on 18 Jun 2015, 09:12 AM
Any results here ? I am reproducing the exact same issue
0
Dimitrina
Telerik team
answered on 18 Jun 2015, 03:41 PM
Hi,

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
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
Amir
Top achievements
Rank 1
answered on 18 Jun 2015, 04:15 PM

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

0
Dimitrina
Telerik team
answered on 18 Jun 2015, 04:30 PM
Hi,

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
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
Tags
TreeListView
Asked by
Charlie
Top achievements
Rank 1
Answers by
Charlie
Top achievements
Rank 1
Dimitrina
Telerik team
Amir
Top achievements
Rank 1
Share this question
or