Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

TreeView ImageList problem.

Hi.

I'm altering the "Items" property of a treeview at runtime by enumerating a DB table and adding the records in under their appropriate headings.

This is all fine, but then I decided to add images to the items.  The problem I found is that when I click on an item in the treeview, it automatically reverts to an ImageIndex of 0, even though it's 1 (for example).  When I click another item, it goes back to what it should be.  It seems that every item, when clicked, gets it's image from index 0.  I do not want this.  I want items to retain their own icon, even when selected.  To be honest, if this isn't a bug, I don't see any useful reason for it.

Any ideas?

John.
0
Jaymol
Asked:
Jaymol
  • 2
1 Solution
 
kretzschmarCommented:
provide also an selected_index for your node
0
 
kretzschmarCommented:
usual the same as the imageindex
0
 
JaymolAuthor Commented:
Oh yeah.  I see now.  (Donkey!)

Thanks.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now