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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top