I work with C ++ and .NET 1.1. I have a problem with programmatically extending TreeNode objects when they are assigned to TreeView. When running the following code in debug mode:
TreeView* myTreeView = new TreeView();
TreeNode* myTreeNode = new TreeNode();
myTreeNode->Expand();
myTreeView->Nodes->Add(myTreeNode);
myTreeNode->Expand();
I see that the property IsExpanded myTreeNodematters truewhen the first one is executed Expand(), but when adding node to myTreeView IsExpanded, the value is set false, and the second Expand()has no effect.
Can anyone explain this behavior? I think there is a parameter for TreeView or something similar, but I could not find anything like it, and from the MS code example this should work fine, so I probably miss something pretty obvious ...
source
share