Strikethroughed text in a TreeViewItem using a ItemTemplate

1 posts, 0 answers
  1. Tobias
    Tobias avatar
    15 posts
    Member since:
    Apr 2013

    Posted 11 Apr 2013 Link to this post

    Hi folks,
    I have the following problem:
    1. I have a RadTreeViewItemTemplate 
    2. I want to set the text decoration to strikethrough
    3. I want to use a template and not a new control
    4. Please help. :)

    I checked several blogs and forum posts, nothing really helped me. 

    Thanks a lot!

    - Tobias

        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                <TextBlock x:Name="MyText" Text="{Binding Name}"/>

    I solved the first problem with the following changes:
    <TextBlock Text="{Binding Name}"/>
    <Rectangle Height="1" VerticalAlignment="Center" Fill="Black" />

    So, I need a way how to set diffrent template - because only delete items should be strikeouted.


    I found a solution. You need a TreeViewItemTemplateSelector and a HierarchicalDataTemplate incl. Code-Behind files.
    It works! Yay.

    - Tobias 
Back to Top