I thought this would work, but it doesn't seem to...
I have an List of Objects called myList
I have a TreeView that I populate using the list, something like:
When I edit an object, I create a new object and copy the data over and put it in the Form.Tag (I use a copy so that changes can be backed out from).
So when the changes are saved back to the original object, I do something like:
I thought that the object in the treeNode Tag was just a reference to the object in the List and changing one would change the other. But that's not happening? The object in the TreeNode.Tag is changed, but the object in the List is not??
I have an List of Objects called myList
I have a TreeView that I populate using the list, something like:
VB.NET:
for each a in myList
Dim n as new TreeNode
n.Tag = a
n.Text = a.Text
TreeView.Add(n)
next
When I edit an object, I create a new object and copy the data over and put it in the Form.Tag (I use a copy so that changes can be backed out from).
So when the changes are saved back to the original object, I do something like:
VB.NET:
TreeNode.Tag = editedObject
I thought that the object in the treeNode Tag was just a reference to the object in the List and changing one would change the other. But that's not happening? The object in the TreeNode.Tag is changed, but the object in the List is not??