Answer found, as documented here: http://support.microsoft.com/kb/2527108.
Creating a custom control derived from TreeNode
is not enough, two other steps are required:
- Enable the control to save its additional properties in the viewstate.
- Create another custom control derived from
TreeView
, which knows how to recreate those customTreeNode
s when a postback happens.