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:RadTreeView.ItemTemplate>
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
            <Grid>
                <TextBlock x:Name="MyText" Text="{Binding Name}"/>
            </Grid>
        </telerik:HierarchicalDataTemplate>
    </telerik:RadTreeView.ItemTemplate>


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


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

    SOLUTION

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

    - Tobias 
Back to Top