Inherited TreeNode

B

Bernhard Wurm

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top