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

Underline selected tree item

2 Answers 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Daniel PIper
Top achievements
Rank 1
Daniel PIper asked on 21 Jun 2010, 04:49 PM
Hello,

Having a tree view with a hierarchical data template containing an image and a text block control, what I'm trying to do is: when Control key is pressed and mouse cursor is hovering the tree, the current hovered item should be underlined and when a certain underlined node is left, the underline is also removed from that node. Although one direct solution I know is to set the TextDecorations property of TextBlock control to Underline, I can't figure how exactly I can do this for only item (I can switch the item template but this will underline all nodes). Another thing I've tried was to the set the style of an item manually but in this case I must be omitting something since the horizontal alignment of the underlined item is broken for some reason. Any suggestion is welcomed.

Thanks in advance!

Daniel

2 Answers, 1 is accepted

Sort by
0
Viktor Tsvetkov
Telerik team
answered on 22 Jun 2010, 01:48 PM
Hi Daniel PIper,

Attached is a sample project showing you an approach to your problem. Review it and tell me if it works for you.

On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverilght applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

Best wishes,
Viktor Tsvetkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Daniel PIper
Top achievements
Rank 1
answered on 23 Jun 2010, 12:22 PM
Hi Viktor ,

It works great. And it's kinda obvious. I think I needed an outside perspective. Thank you for the quick answer.

Kind regards,

Daniel
Tags
TreeView
Asked by
Daniel PIper
Top achievements
Rank 1
Answers by
Viktor Tsvetkov
Telerik team
Daniel PIper
Top achievements
Rank 1
Share this question
or