Welcome Guest Search | Active Topics | Sign In | Register

Subclassing the TreeView Options
Craig
Posted: Sunday, May 11, 2008 8:58:36 PM
Rank: Member
Groups: Member

Joined: 3/4/2008
Posts: 14
we are having problems when trying to sub-class the treeview.. we want to add some properites. Is this possible? maybe it's an asp.net issue.

Specifically .. I can subclass a tree Node, but when I need to iterate over a collection of treeNodes I can't pass in the base class to the method...
eo_support
Posted: Monday, May 12, 2008 5:10:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Hi Craig,

You won't be able to do that. The reason is that when the TreeView tries to reconstruct the TreeNodes from view state when the page is posted back, it has no knowledge about your subclassed TreeNode type.

If you wish to store anything in the TreeNode, you can store some kind of key information in the TreeNode's Value property as a string. That way it can always be corrected saved/restored. You will then rely on this key information to restore other information.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.