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.
LVL 6
JaymolAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kretzschmarConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.