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

[Solved] Stack Overflow Error

5 Answers 217 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Som
Top achievements
Rank 1
Som asked on 29 Jan 2008, 03:26 PM
If I add attributes to the children nodes, I get a stack overflow error in the internet explorer. Here is the code:

childNode.Attributes.Add("Category", (string)row["Type"]);


I will appreciate if you could please look into it.

Thanks
Som

5 Answers, 1 is accepted

Sort by
0
Fernandes
Top achievements
Rank 1
answered on 29 Jan 2008, 07:11 PM
Hi Som,

Without knowing the rest of your code, I would suppose the error has something to do with:

(string)row["Type"

Here's a sample that adds custome attributes to childnodes.

StackOverflow.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StackOverflow.aspx.cs" Inherits="StackOverflow" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Stack Overflow</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server" />    
    <div> 
        <telerik:RadTreeView ID="RadTreeView1" runat="server" Height="234px" LoadingStatusPosition="BeforeNodeText">  
            <Nodes> 
                <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Main">  
                    <Nodes> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Sub_Item_1">  
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Sub_Item_2">  
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Sub_Item_3">  
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Sub_Item_4">  
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Sub_Item_5">  
                        </telerik:RadTreeNode> 
                    </Nodes> 
                </telerik:RadTreeNode> 
            </Nodes> 
            <CollapseAnimation Duration="100" Type="OutQuint" /> 
            <ExpandAnimation Duration="100" Type="OutQuart" /> 
        </telerik:RadTreeView> 
      
    </div> 
    </form> 
</body> 
</html> 
 


And the code behind:
StackOverflow.aspx.cs
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
 
public partial class StackOverflow : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        foreach (RadTreeNode childNode in RadTreeView1.Nodes[0].Nodes)  
        {  
            childNode.Attributes.Add("Category""Category_" + childNode.Index.ToString());   
        }  
    }  
}  
 

Hope it helps!

Fernandes
0
Som
Top achievements
Rank 1
answered on 31 Jan 2008, 06:59 PM
I even changed the code to use hard-coded string:

childNode.Attributes.Add("Category", "test attribute");

but still the same error. I am using the ServerSideCallBack mode and I get the "Stack Overflow Error" when I expand a node.


0
Atanas Korchev
Telerik team
answered on 01 Feb 2008, 06:50 AM
Hi Som,

This could be a well known issue of RadTreeView prometheus which we have fixed in our latest official release - Service Pack 1. Please try upgrading.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Som
Top achievements
Rank 1
answered on 05 Feb 2008, 07:09 PM
Couple of things:

1. Earlier I was sent a hotfix version to enable keyboard support for opening context menus and it seems that fix has not been included in the latest version because when I upgraded the version, the keyboard support to open context menus stopped working.

2. The upgrading did not resolve the stack overflow error. I am currently using version 2007.3.1218.20.

I will appreciate if you could please try to reproduce the error at your end and find a solution ASAP.
0
Atanas Korchev
Telerik team
answered on 06 Feb 2008, 08:32 AM
Hello Som,

The service pack version is 2007.3.1314.20. You still seem to be using the old version which have both problems - stack overflow error and context menu code.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Som
Top achievements
Rank 1
Answers by
Fernandes
Top achievements
Rank 1
Som
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or