horizontal stretch with templateselector

2 posts, 0 answers
  1. Cristovao
    Cristovao avatar
    24 posts
    Member since:
    Jun 2012

    Posted 15 Jan 2013 Link to this post

    I have a strange issue ... when I do this:

    <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                              <DataTemplate>
     
     
                                  <Grid   Background="{Binding BackgroundResource, Converter={StaticResource ColorToBrushConverter}}" Height="96" Margin="12">
                                      <Grid.ColumnDefinitions>
                                          <ColumnDefinition Width="96"></ColumnDefinition>
                                          <ColumnDefinition ></ColumnDefinition>
                                      </Grid.ColumnDefinitions>
                                      <Image Source="{Binding BackgroundResource, Converter={StaticResource IconConverter}}" Width="48" Height="48"></Image>
                                      <TextBlock Text="{Binding Title}" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center"/>
                                  </Grid>
                              </DataTemplate>
                          </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                          <telerikPrimitives:RadDataBoundListBox.ItemContainerStyle>
                              <Style TargetType="telerikPrimitives:RadDataBoundListBoxItem">
                                  <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                              </Style>
                          </telerikPrimitives:RadDataBoundListBox.ItemContainerStyle>
                      </telerikPrimitives:RadDataBoundListBox>


    the line stretchs...

    yet doing this 

    <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                             <DataTemplate>
                                 <code:MainMenuTemplateSelector Content="{Binding}">
                                     <code:MainMenuTemplateSelector.Area>
                                         <DataTemplate>
                                             <Grid   Background="{Binding BackgroundResource, Converter={StaticResource ColorToBrushConverter}}" Height="96" Margin="12">
                                                 <Grid.ColumnDefinitions>
                                                     <ColumnDefinition Width="96"></ColumnDefinition>
                                                     <ColumnDefinition ></ColumnDefinition>
                                                 </Grid.ColumnDefinitions>
                                                 <Image Source="{Binding BackgroundResource, Converter={StaticResource IconConverter}}" Width="48" Height="48"></Image>
                                                 <TextBlock Text="{Binding Title}" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center"/>
                                             </Grid>
                                         </DataTemplate>
                                     </code:MainMenuTemplateSelector.Area>
                                     <code:MainMenuTemplateSelector.Family>
                                         <DataTemplate>
                                             <Border BorderThickness="2" BorderBrush="{Binding BackgroundResource, Converter={StaticResource ColorToBrushConverter}}" Height="96" Margin="12">
                                                 <TextBlock Foreground="{Binding BackgroundResource, Converter={StaticResource ColorToBrushConverter}}" Text="{Binding Title}" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center"/>
                                             </Border>
     
                                         </DataTemplate>
                                     </code:MainMenuTemplateSelector.Family>
                                     <code:MainMenuTemplateSelector.SubFamily>
                                         <DataTemplate>
                                             <Grid Background="{Binding BackgroundResource, Converter={StaticResource ColorToBrushConverter}}" Height="96" Margin="12">
                                                 <TextBlock Text="{Binding Title}" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center"/>
                                             </Grid>
                                         </DataTemplate>
                                     </code:MainMenuTemplateSelector.SubFamily>
                                 </code:MainMenuTemplateSelector>
                             </DataTemplate>
                         </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                         <telerikPrimitives:RadDataBoundListBox.ItemContainerStyle>
                             <Style TargetType="telerikPrimitives:RadDataBoundListBoxItem">
                                 <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                             </Style>
                         </telerikPrimitives:RadDataBoundListBox.ItemContainerStyle>
                     </telerikPrimitives:RadDataBoundListBox>

    it doesnt ...
    strange isn't ?
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 16 Jan 2013 Link to this post

    Hello Cristovao,

    Thanks for writing.

    I am not quite sure that I correctly understand the case.

    Can you please provide me with some further details like screenshots or steps to reproduce the case so that I can make sure that I correctly understand it?

    It will be great if you manage to attach a sample project that reproduces the issue as well.

    Regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top