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

TreeListView crashes with more than 8 items?

7 Answers 72 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Francois Lamy
Top achievements
Rank 1
Francois Lamy asked on 13 May 2010, 02:25 PM
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.

7 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 13 May 2010, 02:54 PM
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.
0
Francois Lamy
Top achievements
Rank 1
answered on 13 May 2010, 03:21 PM
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
0
Miroslav
Telerik team
answered on 13 May 2010, 03:52 PM
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.
0
Francois Lamy
Top achievements
Rank 1
answered on 13 May 2010, 06:43 PM
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] 

0
Miroslav
Telerik team
answered on 18 May 2010, 02:05 PM
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.
0
FENWICK
Top achievements
Rank 1
answered on 27 Feb 2013, 02:28 PM
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  ?
0
Dimitrina
Telerik team
answered on 27 Feb 2013, 03:07 PM
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.

Tags
TreeListView
Asked by
Francois Lamy
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Francois Lamy
Top achievements
Rank 1
FENWICK
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or