Home - Forums-.NET - FlyTreeView (ASP.NET) - Using Context Menu

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Using Context Menu
Link Posted: 26-Oct-2006 04:33
Hi,

I am using FlyTreeView for ASP.NET 1.1, and having trouble implementing context menu.  The menu works fine when 1st loaded, but when the screen reloaded due to user selection any click event on any part of the screen opens pop-up error msg saying \"Stack overflow at line: ##\".  The error happens only when i have context menu on the aspx.

i have something like following:

on ASPX;

a few dropdown controls which will cause screen to refresh and reset the tree.
...




....



        
        
        
        
                  AutoPostBack=\"True\" Text=\"AutoPostBack with confirm\">
        
        
        
      



on CS, codebehind page onload method:

read dropdown value or use default to set parameter.
...
FlyTreeView.Nodes.Clear();
FlyTreeView..ExpandLevel = set using one of the param value
...
Build TreeView by adding Nodes to the tree....


hope to hear from you soon.  Thanks.
Link Posted: 26-Oct-2006 05:28
I've just tested the demo page at
http://www.9rays.net/asp.net/treeview/Demos.aspx
-- selected node
-- clicked postback page
-- clicked page
Everything is OK so far. Does it work from your computer?

It seems that the problem is in compatibility of context menu and some javascript in your page.

Could you please try to move the treeview implementation code to blank page to detect the reason of the problem?
Link Posted: 26-Oct-2006 06:41
looks like CS sample code got cut out.  here it is..

public class Test : System.Web.UI.Page
  {
    #region Controls
    protected System.Web.UI.WebControls.DropDownList ddlType;
    protected NineRays.Web.UI.WebControls.FlyTreeView.FlyTreeView FTV;
    protected NineRays.Web.UI.WebControls.FlyTreeView.FlyContextMenu FlyContextMenu;
    //protected asp_net_web.UserControl ctlTreeView;
    #endregion

    #region Members
    private NineRays.Web.UI.WebControls.FlyTreeView.TreeNode node;
    #endregion

    #region Methods
    private void Page_Load(object sender, System.EventArgs e)
    {
      FTV.Nodes.Clear();
      FTV.ExpandLevel = 2;
      
      node = new NineRays.Web.UI.WebControls.FlyTreeView.TreeNode();
      node.Key = \"1\";
      node.Text = \"Test1\";
      FTV.Nodes.Add( node );

      node = new NineRays.Web.UI.WebControls.FlyTreeView.TreeNode();
      node.Key = \"2\";
      node.Text = \"Test2\";
      FTV.Nodes.Add( node );
    }

    #endregion

    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
      //
      // CODEGEN: This call is required by the ASP.NET Web Form Designer.
      //
      InitializeComponent();
      base.OnInit(e);
    }
    
    ///
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    ///
    private void InitializeComponent()
    {    
      this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
  }
Link Posted: 27-Oct-2006 06:32
It work ok here. The only error I get is that handleNodeEvent is not defined. So I removed onNodeClientEvent=\"handleNodeEvent();\".
No errors so far.
Link Posted: 27-Oct-2006 06:34
using IE6 sp2