NullReferenceException in TreeListView

7 posts, 0 answers
  1. Charlie
    Charlie avatar
    2 posts
    Member since:
    May 2014

    Posted 21 May 2014 Link to this post

    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?





  2. Charlie
    Charlie avatar
    2 posts
    Member since:
    May 2014

    Posted 21 May 2014 in reply to Charlie Link to this post

    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 )
  3. DevCraft banner
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 21 May 2014 Link to this post

    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.
     
  5. Amir
    Amir avatar
    6 posts
    Member since:
    Nov 2011

    Posted 18 Jun 2015 in reply to Dimitrina Link to this post

    Any results here ? I am reproducing the exact same issue
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Jun 2015 Link to this post

    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
  7. Amir
    Amir avatar
    6 posts
    Member since:
    Nov 2011

    Posted 18 Jun 2015 in reply to Dimitrina Link to this post

    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

  8. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Jun 2015 Link to this post

    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
Back to Top
DevCraft banner