Hi everyone! I need help to cast a TreeNode into my own-defined TreeNode class (called ExtraTreeNode); the TreeNode has been added to the tree as ExtraTreeNode.
For example, I have some properties (p1, p2) in ExtraTreeNode.
Creating my object:
ExtraTreeNode tempnode = new ExtraTreeNode(p1,p2);
The problem is later on (usually after a postback) when I try to reference to the node I cannot cast it using my class.
Then I get the following error,
"Unable to cast object of type 'System.Web.UI.WebControls.TreeNode' to type 'ExtraTreeNode'".
If some has done this before and can give some feedback, it would be awesome.
Can the asp .net TreeNode class extended to persist user-defined properties?
If not what TreeView/node would you recommend?