Solved

Changing TreeNode Images

Posted on 2006-11-24
4
252 Views
Last Modified: 2010-04-23
hi

i have a TreeView that contains various TreeNodes

i have set the ImageIndex to a closed folder image, and the SelectedImageIndex to an open folder image.

this works fine when i double click the treenode, the images swap around... BUT when I use the expan/collapse feature of the TreeView (ie the + and - icons), the images don't change...

any ideas?

cheers,
0
Comment
Question by:A4eIT
4 Comments
 
LVL 6

Expert Comment

by:manch
ID: 18006757

Actually when u expand or collapse the Tree View Nodes the Node is not Selected so the SelectedImageIndex won't work for that

SelectedImageIndex is basically when the node is selected then the image is displayed

(Try to select the Node u want it will work fine u have to find the Index of the Node and then set the SelectedNode property of the TreeView to that paritcular node)

Try it
0
 

Author Comment

by:A4eIT
ID: 18006857
many thanks

please could you advise me how to do that? what event fires when i click on the '+' or '-'?

thx
0
 
LVL 8

Expert Comment

by:doraiswamy
ID: 18007237
When you click +, the 'beforeexpand' event fires, the nodes expand and then the 'afterexpand' event fires. Similarly, the - has 'beforecollapse' and 'aftercollapse' events.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 18007658
Hi A4eIT,

I have written an article on that in April 2006 that you can read from http://emoreau.s2i.com/

Cheers!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now