This is a migrated thread and some comments may be shown as answers.

Overlay/State Icons for nodes

2 Answers 235 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
AccSys
Top achievements
Rank 1
AccSys asked on 22 Jul 2011, 04:29 PM
Hi,

Is there a method for adding "State"/"Overlay" icons to tree nodes? Such that you have an Image set for the node, but can then apply an overlay icon to show it's "State"?

This would allow us to show a "Virtual", "Readonly" state on top of the normal HTML, PDF icons we're using etc.

Thanks,
Paul

2 Answers, 1 is accepted

Sort by
0
AccSys
Top achievements
Rank 1
answered on 25 Jul 2011, 10:02 AM
In addition, I've just downloaded 2011 Q2, as the documentation here:

http://www.telerik.com/help/winforms/treeview-working-with-nodes-node-images.html

Says that you can specify a StateImage on a RadTreeNode:

//RadTreeNode node = new RadTreeNode("RadNode");
//node.ImageIndex = 0;
////NICK
////node.StateImageIndex = 1;
////node.SelectedImageIndex = 2;

But the properties mentioned don't appear to exist. I've updated my project using the Telerik tool, and the version references on the DLLs are correct.

0
Stefan
Telerik team
answered on 25 Jul 2011, 02:04 PM
Hello guys,

Thank you both for writing.

The article that you are referring to is outdated and it concerns an old version of RadTreeView (this is why it is not accessible through the documentation navigation tree). The properties shown in this help article concern only the three states - normal, selected and expanded. All these are still achievable by making use of the NodeFormatting event. However, overlaying images was not and it is still not supported out of the box. 

A possible approach is to set both the Image and BackgroundImage properties of the ImageElement of TreeNodeElement and then set the ImageOpacity to 0.5. This way the the image will be faded and the background image will be visible underneath. Please refer to the attached sample project. I hope that this will work for you.

Should you have any other questions, do not hesitate to contact us.

Kind regards,
Stefan
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Treeview
Asked by
AccSys
Top achievements
Rank 1
Answers by
AccSys
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or