HierarchicalDataTemplate Stretch

2 posts, 0 answers
  1. Kurt
    Kurt avatar
    17 posts
    Member since:
    Aug 2006

    Posted 01 Sep 2011 Link to this post

    I have been trying to figure out how to create a more customzed HierarchicalDataTemplate.

    I am using the following template:

    <telerik:HierarchicalDataTemplate x:Key="TreeItemTemplate"
                                            telerik:ContainerBinding.ContainerBindings="{StaticResource TreeBinder}">
              <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Width="Auto">
                      <RowDefinition />
                      <ColumnDefinition Width="18" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="18" />
                  <Image Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
                         Source="{Binding ImageSrc}" Margin="4,0,4,0" Height="16" Width="16" />
                  <TextBlock Grid.Column="1" Text="{Binding Name}"  />
                  <Image  Grid.Column="2" Source="Resources/del_16.png"
                          HorizontalAlignment="Center" VerticalAlignment="Center"  Height="16" Width="16" />

    So, I was hoping to have a delete icon that maintained a right aligned position within a TreeView.

    So far this has not worked.. :(

    Any ideas would be welcome..

  2. Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 02 Sep 2011 Link to this post

    Hi Kurt,

    Is the image bellow describing what you're trying to achieve. If so, please take a look at the attached project.

    Best wishes,
    Kiril Stanoev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top