6 Answers, 1 is accepted
"Logical tree depth exceeded while traversing the tree. This could indicate a cycle in the tree."
I put together a simple sample app that just displays a table and attempts to sum a column. If I do it in XAML it works great, but I need to be able to do this in the codebehind.
Here's a snippet of code....ShowColumnFooters is set to true in the XAML,,,doesn't matter if I put it in the xaml or code behind as soon as I attempt to do this inside the codebehind it errors. If I remove the showcolumnfooters and leave everything else as is, it'll display the column in question.....but I can't get the footerrow.
This was just a quick test to try to figure this out.......am I missing something????
DataClasses1DataContext dc = new DataClasses1DataContext();
gridview1.ItemsSource = dc.FACDAILYPENALTies;
GridViewDataColumn column = new GridViewDataColumn();
SumFunction sum = new SumFunction();
GridViewFooterRow footerRow = new GridViewFooterRow();
column.Footer = footerRow;
I figured it out.......
I am receiving the same “Logical tree depth exceeded while traversing the tree. This could indicate a cycle in the tree.” error.My scenario is different, but since this is the only post that mentions the error, I am wondering what caused and solved the error for you?
<gridview:RadGridView Name="radGridView" ShowColumnFooters="True" telerik:StyleManager.Theme="Vista" Grid.Column="1" Grid.ColumnSpan="17" Margin="8,15,60,0" Grid.Row="5" Grid.RowSpan="10"></gridview:RadGridView>
And I set ShowColumnFooters = true,,,,this pretty much took care of my problem, I was able to do everything else in the code behind.
For common operations on our grids we have a utilities class with a number of public static methods. One of them is CreateRadGridViewColumnn() and that method has various overloads. One of the overloaded methods is for handling columns with aggregates. When the column is created, we use the overloaded method to to configure that column and that overloaded method based on the parameters passed to it calls another method that gets/configures the aggregate function to be added to the column. Once the aggregate is added to the column, you're pretty much done.....
With the XAML set to show the column footers and the aggregate being added in side my create column method, that solved me problem, it would display the aggregated data in the column footer just as intended.