TreeStructure problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

In my program I'm using a class, which can nested like the TreeNodes in a
TreeView, thus I also want to use a TreeView to display some of the content
(a short string) of these nested classes. The user shall then be able to take
further actions when by clicking on the TreeNodes. Here comes the problem:
How do I map the currently selected TreeNode to the appropriate instance of
the nested class?
 
Hi!

In my program I'm using a class, which can nested like the TreeNodes in a
TreeView, thus I also want to use a TreeView to display some of the content
(a short string) of these nested classes. The user shall then be able to take
further actions when by clicking on the TreeNodes. Here comes the problem:
How do I map the currently selected TreeNode to the appropriate instance of
the nested class?

You could use the tag property of the treenode. In the tag property you can
store whatever you want. So for example the reference to the object the
treenode represents.
 
Claudio Grazioli said:
You could use the tag property of the treenode. In the tag property you can
store whatever you want. So for example the reference to the object the
treenode represents.

Thanks a lot. That's exactly what I was looking for!
 
Back
Top