TreeListView crashes with more than 8 items?

8 posts, 0 answers
  1. Thomas Whittaker
    Thomas Whittaker avatar
    34 posts
    Member since:
    Sep 2009

    Posted 13 May 2010 Link to this post

    I am not sure when this started happening for me but whenever I expand my tree such that I have more than 8 items it will crash my application.  I tracked it down to the CumulativeValue function on the IndexTree class, which is getting called by ExtendDesiredSize on the TreeViewPanel class, which is getting called by MeasureOverride on TreeViewPanel.  The CumulativeValue function is getting an index out of bounds exception.

    Anyone have any ideas on this?  I am stumped.  I swear this worked just fine prior to switching to the Q1 2010 controls, but, again, I am not certain when this started happening.
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 13 May 2010 Link to this post

    Hello Thomas,

    This is quite strange. I am not aware of such issue.

    The simple project I used to try to reproduce this is attached. Possibly I am missing something.

    Can you help us reproduce this?
    Which version of the controls are you using?
    Is it Silverlight 3 or 4?
    How do you add the items?

    Regards,
    Miroslav
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Thomas Whittaker
    Thomas Whittaker avatar
    34 posts
    Member since:
    Sep 2009

    Posted 13 May 2010 Link to this post

    Miroslav,

    You are right.  Your sample does not exhibit the same behavior as my code.  I will have to try to figure out what the difference is...  We have heavily customized and extended the TreeListView, so it is obviously something in our extensions.  Thanks for the quick reply!  I will let you know if I figure anything out.

    -Tom
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 13 May 2010 Link to this post

    Hello Thomas,

    At any rate this exception is quite unexpected even if the control is customized.

    Can you send me the call stack?
    Does this happen when the root items are more than 8 or it can be the children as well?
    Do you reset the items in some way?

    Regards,
    Miroslav
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  6. Thomas Whittaker
    Thomas Whittaker avatar
    34 posts
    Member since:
    Sep 2009

    Posted 13 May 2010 Link to this post

    Miroslav,

    Our data has 1 root item and is Loaded on Demand.  If the number of children under the root item exceeds 7 (so that there are more than 8 total items) I get the error.  I will also get the error if the

    When I am attached in the debugger and I turn on break on exceptions thrown, the call stack I get looks like this:

    > Telerik.Windows.Controls.Navigation!Telerik.Windows.Controls.TreeView.IndexTree.CumulativeValue(int endIndex = 9) + 0x4e bytes 
      Telerik.Windows.Controls.Navigation!Telerik.Windows.Controls.TreeView.TreeViewPanel.ExtendDesiredSize(Telerik.Windows.Controls.ItemsControl itemsControl = {Relex.Web.Silverlight.Viewports.RelexTree}, System.Windows.Size stackDesiredSize = {System.Windows.Size}, int pivotIndex = 1, bool before = false) + 0x136 bytes 
      Telerik.Windows.Controls.Navigation!Telerik.Windows.Controls.TreeView.TreeViewPanel.MeasureOverride(System.Windows.Size constraint = {System.Windows.Size}) + 0x1d21 bytes 
      System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget, float inWidth, float inHeight, out float outWidth = 0.0, out float outHeight = 0.0) + 0xa3 bytes 
      [Appdomain Transition] 

  7. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 18 May 2010 Link to this post

    Hello Thomas Whittaker,

    May I ask again which version of the controls you use? We fixed a certain scenario which broke the IndexTree but the callstack of this issue looks something like it.

    Also what modifications to the TreeList have you made?

    Regards,
    Miroslav
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  8. FENWICK
    FENWICK avatar
    30 posts
    Member since:
    Jul 2010

    Posted 27 Feb 2013 Link to this post

    Hi,

    I've the same problem but on a Treeview control. When I have more than 8 items, Drag&drop crash on the "CumulativeValue" method in IndexTree class.

    I think that this problem due to the constructor of IndexTree class : 

    internal IndexTree(int capacity, double defaultValue)
          {
              this.count = capacity;
              this.size = 8;
              while (this.size < capacity)
              {
                  this.size = this.size << 1;
              }
              this.tree = new double[this.size << 1];
              this.itemDefaultValue = defaultValue;
              this.Initialize(defaultValue);
          }

    When you drag an element, i think this element is temporary duplicated. So "size" property is smallest
    is there a trick to solve this problem  ?
  9. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 Feb 2013 Link to this post

    Hello,

    Please note that the RadTreeView is a different control. Please open ticket in the relevant forum category. 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner