Image index of TreeView node changes upon selection

Sudhir  picture Sudhir · Nov 1, 2009 · Viewed 12k times · Source

When I tried using the imagelist in treeview, the image index changes when treenode is clicked. I have no idea why it is happening. Can anyone help me?

Thanks in advance

Answer

Matt Breckon picture Matt Breckon · Nov 1, 2009

You need to set both the ImageIndex and the SelectedImageIndex on the tree node.