This is a migrated thread and some comments may be shown as answers.

Strange ItemTemplate behaviour

2 Answers 79 Views
ExpanderControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ilija
Top achievements
Rank 1
Ilija asked on 02 Nov 2012, 01:21 PM
Hi,

I have some kind of really strange behavior, using the Expander in an ItemTemplate for a RadDataBoundListBox. After expanding the content, there is a line, right under the expander, showing the type that is bound to the ItemsSource of the RadDataBoundListBox.

Below you can see the DataTemplates I used, and I attached also an image. Thank you for your help.

<DataTemplate x:Key="LinksExpanderContentTemplate">
           <Grid Background="LightGray">
               <StackPanel Orientation="Horizontal">
                   <Image x:Name="imgVoteUp"
                          Height="32" VerticalAlignment="Center"
                          Width="32" Source="Images/Road-Forward.png" />
                   <TextBlock x:Name="tbVoteCount"
                              Text="{Binding Ranking.Votes}"
                              FontSize="18" Foreground="White" VerticalAlignment="Center"></TextBlock>
                   <Image x:Name="imgVoteDown"
                          Height="32"
                          Width="32" VerticalAlignment="Center"
                          Source="Images/Road-Backward.png" />
                   <StackPanel VerticalAlignment="Center">
                       <TextBlock x:Name="tbLinkTitleHeader"
                                  Text="{Binding Title,Converter={StaticResource titleconv}}"
                                  Foreground="#FF1586EA" />
                       <TextBlock x:Name="tbCreationInformation"
                                  Text="{Binding CreationData}"
                                  FontSize="9" />
                   </StackPanel>
                   </StackPanel>
 
           </Grid>
       </DataTemplate>
       <DataTemplate x:Key="ListExpanderExpandedTemplate">
           <Grid Background="LightGray">
               
               <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
                   <TextBlock Text="{Binding Title}"
                              x:Name="linkTitle"
                              FontSize="11"
                              TextWrapping="Wrap"
                              FontWeight="Bold"
                              Foreground="#FF1586EA"
                              Margin="0,3,0,0" />
                   <StackPanel Orientation="Horizontal"
                               Margin="3,0,0,0">
                       <Image Height="16" VerticalAlignment="Center"
                              Width="16"
                              Source="Images/geeklisticons/links.png" />
                       <TextBlock Text="{Binding Url}"
                                  VerticalAlignment="Center" x:Name="tbLinkURL"
                                  Margin="3,0,0,0" />
                   </StackPanel>
                   <StackPanel Orientation="Horizontal"
                               Margin="3,0,0,0">
                       <Image Height="16" VerticalAlignment="Center"
                              Width="16"
                              Source="Images/folder.png" />
                       <TextBlock Text="{Binding Category.Name}"
                                  VerticalAlignment="Center" x:Name="tbLinkFolder"
                                  Margin="3,0,0,0" />
                   </StackPanel>
                   <TextBlock Text="{Binding CreationData}"
                              x:Name="tbPublishTimeSpan"
                              Margin="0,5,0,0"
                              FontStyle="Italic" />
               </StackPanel>
           </Grid>
       </DataTemplate>
       <DataTemplate x:Key="LinksAnimatedIndicatorContent">
           <Grid />
       </DataTemplate>
       <DataTemplate x:Key="LinksItemTemplate">
           <Grid x:Name="outerGrid"
                 >
               <telerikPrimitives:RadExpanderControl Content="RadExpanderControl"
                                                     x:Name="linkExpander"
                                                     HorizontalAlignment="Stretch"
                                                     VerticalAlignment="Stretch"
                                                     ContentTemplate="{StaticResource LinksExpanderContentTemplate}"
                                                     ExpandedStateContentTemplate="{StaticResource ListExpanderExpandedTemplate}"
                                                     AnimatedIndicatorContentTemplate="{StaticResource LinksAnimatedIndicatorContent}" />
 
           </Grid>
           
            
       </DataTemplate>

2 Answers, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 05 Nov 2012, 03:50 PM
Hi Ilija,

Thanks for contacting us.

The reason for this behavior is that you are not setting the ExpandableContent/ExpandableContentTemplate properties. The ExpandableContent property is what is displayed when the ExpanderControl is expanded. The ExpandedStateContent is what is visible in the header of the control when it is expanded. You can also overcome this behavior by setting the ExpandableContent property on XAML to {x:Null}.

Please take a look at our online help for more information on using ExpanderControl:

http://www.telerik.com/help/windows-phone/radexpandercontrol-gettingstarted.html

I hope this helps.

All the best,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ilija
Top achievements
Rank 1
answered on 05 Nov 2012, 08:35 PM
Hi Deyan,

thank you for your help :)

Best,
Ilija
Tags
ExpanderControl
Asked by
Ilija
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Ilija
Top achievements
Rank 1
Share this question
or