This is a migrated thread and some comments may be shown as answers.
HierarchicalDataTemplate Stretch
1 Answer 23 Views
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 01 Sep 2011, 03:43 PM
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">
              <Grid.RowDefinitions>
                  <RowDefinition />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="18" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="18" />
              </Grid.ColumnDefinitions>
              <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" />
          </Grid>
 
      </telerik:HierarchicalDataTemplate>

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..
Kurt

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 02 Sep 2011, 04:11 PM
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 >>

Asked by
Kurt
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or