Underline selected tree item

3 posts, 0 answers
  1. Daniel PIper
    Daniel PIper avatar
    2 posts
    Member since:
    Dec 2009

    Posted 21 Jun 2010 Link to this post


    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!

  2. Viktor Tsvetkov
    Viktor Tsvetkov avatar
    382 posts

    Posted 22 Jun 2010 Link to this post

    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
  3. Daniel PIper
    Daniel PIper avatar
    2 posts
    Member since:
    Dec 2009

    Posted 23 Jun 2010 Link to this post

    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,

Back to Top