Inherited TreeNode

Discussion in 'ASP .Net Web Controls' started by Bernhard Wurm, Sep 8, 2005.

  1. Hello Together!

    I try to implement a TreeView with a ContextMenu. Therefore I wrote a own
    TreeNodeClass which inherits System.Web.UI.WebControls.TreeNode.

    Now I wrote something like the following:
    protected void Page_Load(object sender, EventArgs e) {

    if (!Page.IsPostBack) {

    myTreeNode tn = new myTreeNode ("myTreeNode");

    myTreeNode tn1 = new myTreeNode ("SubNode");

    myTreeNode tn2 = new myTreeNode ("Without Contextmenu");



    tn.ChildNodes.Add(tn1);

    TreeView1.Nodes.Add(tn);

    TreeView1.Nodes.Add(tn2);

    }

    everything works nice, but when I expand or collapse the Treeview the Nodes
    arn't of the Type myTreeNode! There are of the type of TreeNode!

    How can I handle this! And other properties, which I allready added to the
    Treeview (Treeview is also an inherited customized class) arn't here
    anymore!

    Please help me!

    thanks

    Bernhard Wurm
     
    Bernhard Wurm, Sep 8, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aditi Deo via .NET 247
    Replies:
    0
    Views:
    377
    Aditi Deo via .NET 247
    Jun 5, 2004
  2. naijacoder naijacoder
    Replies:
    1
    Views:
    676
    naijacoder naijacoder
    Sep 15, 2004
  3. tanya foster
    Replies:
    3
    Views:
    3,770
    tanya foster
    May 18, 2006
  4. Replies:
    0
    Views:
    165
  5. 7stud --
    Replies:
    11
    Views:
    442
    7stud --
    Nov 9, 2007
Loading...

Share This Page