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
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