Change the item template only for one item

2 posts, 0 answers
  1. Pierre
    Pierre avatar
    260 posts
    Member since:
    Apr 2007

    Posted 09 May 2011 Link to this post

    Here my code:
    <TelNavigation:RadTreeView VerticalAlignment="Stretch" SelectionMode="Single" AllowDrop="False">
        <TelNavigation:RadTreeViewItem Header="Achats"  IsExpanded="True" DefaultImageSrc="Images/Icones/Module.png">
            <TelNavigation:RadTreeViewItem Name="CommAchats" Header="Commande Achats"  IsExpanded="False" DefaultImageSrc="Images/Icones/Module.png">
                        <TextBlock Text="HELLO"></TextBlock>
            <TelNavigation:RadTreeViewItem Name="Fournisseurs" Header="Fournisseurs"  IsExpanded="False" DefaultImageSrc="Images/Icones/Module.png" />
        <TelNavigation:RadTreeViewItem Header="Ventes"  IsExpanded="False" DefaultImageSrc="Images/Icones/Module.png">
            <TelNavigation:RadTreeViewItem Name="CommClients" Header="Comm Clients"  IsExpanded="False" DefaultImageSrc="Images/Icones/Module.png" />
            <TelNavigation:RadTreeViewItem Name="Clients" Header="Clients"  IsExpanded="False" DefaultImageSrc="Images/Icones/Module.png" />
    I just try to change the control in the item CommAchats for a Image-Text-and 2 imagebuton. For now I just test to display "Hello" instead of the "normal" treeview item. No copile error, but runtime always display the old TreeViewItem

  2. Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 12 May 2011 Link to this post

    Hi Pierre,

    Instead of setting an ItemsPanel, try setting the Header in the following manner:

    <TelNavigation:RadTreeViewItem Name="CommAchats" IsExpanded="False">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/Icones/Module.png"></Image>
                <TextBlock Text="HELLO"></TextBlock>

    Let me know how this works for you.

    Best wishes,
    Kiril Stanoev
    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
Back to Top