Vertical Tab DropDownDisplayMode showing Telerik.Windows.Controls.RadTabItem

2 posts, 0 answers
  1. tmorford
    tmorford avatar
    7 posts
    Member since:
    Jul 2007

    Posted 10 Nov 2009 Link to this post

    Hello all I am having an issue with the DropDownDisplayMode showing Telerik.Windows.Controls.RadTabItem as its item the tabs show up correctly.

    <telerikNavigation:RadTabControl x:Name="tabControl" Grid.Row="1" VerticalAlignment="Stretch"   
                                         HorizontalAlignment="Stretch" RenderTransformOrigin="0.5,0.5"   
                                         Regions:RegionManager.RegionName="MainRegion" TabStripPlacement="Right"    
                                         AllowDragReorder="True" BackgroundVisibility="Collapsed" FontFamily="Tahoma"   
                                         DropDownDisplayMode="Visible" ScrollMode="Viewport" > 
          <infRegionAdapters:RadTabControlRegionAdapter.ItemContainerStyle> 
            <Style TargetType="telerikNavigation:RadTabItem">  
              <Setter Property="RightTemplate">  
                <Setter.Value> 
                  <ControlTemplate TargetType="telerikNavigation:RadTabItem">  
                      <Grid x:Name="wrapper">  
                      <VisualStateManager.VisualStateGroups> 
                        <VisualStateGroup x:Name="CommonStateGroup">  
                          <VisualState x:Name="MouseOver">  
                            <Storyboard> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Bg" Storyboard.TargetProperty="Opacity">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>  
                              </ObjectAnimationUsingKeyFrames> 
                            </Storyboard> 
                          </VisualState> 
                          <VisualState x:Name="Normal"/>  
                          <VisualState x:Name="Selected">  
                            <Storyboard> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Bg" Storyboard.TargetProperty="Opacity">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>  
                              </ObjectAnimationUsingKeyFrames> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Bg" Storyboard.TargetProperty="BorderBrush">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TabBorder_Select}"/>  
                              </ObjectAnimationUsingKeyFrames> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Bg" Storyboard.TargetProperty="Background">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TabBackground_Select}"/>  
                              </ObjectAnimationUsingKeyFrames> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="wrapper" Storyboard.TargetProperty="Margin">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="0 -1 0 0"/>  
                              </ObjectAnimationUsingKeyFrames> 
                              <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HeaderElement" Storyboard.TargetProperty="Foreground">  
                                <DiscreteObjectKeyFrame KeyTime="0" Value="#FF000000"/>  
                              </ObjectAnimationUsingKeyFrames> 
                            </Storyboard> 
                          </VisualState> 
                          <VisualState x:Name="Disabled">  
                            <Storyboard> 
                              <DoubleAnimation Duration="0:0:0.1"   
                                                                 Storyboard.TargetName="HeaderElement"   
                                                                 Storyboard.TargetProperty="Opacity" To="0.5"/>  
                            </Storyboard> 
                          </VisualState> 
                        </VisualStateGroup> 
                        <VisualStateGroup x:Name="FocusStates">  
                          <VisualState x:Name="Unfocused"/>  
                          <VisualState x:Name="Focused"/>  
                        </VisualStateGroup> 
                      </VisualStateManager.VisualStateGroups> 
                      <Border x:Name="Bg" Margin="2 0" Opacity="0" Background="{StaticResource TabBackground_MouseOver}" BorderBrush="{StaticResource TabBorder_MouseOver}" BorderThickness="1,0,1,1" CornerRadius="0,3,3,0"/>  
                      <layoutToolkit:LayoutTransformer> 
                        <layoutToolkit:LayoutTransformer.LayoutTransform> 
                          <RotateTransform Angle="90"/>  
                        </layoutToolkit:LayoutTransformer.LayoutTransform> 
                        <Grid x:Name="HeaderWrapper" Height="30">  
                          <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="Auto"/>  
                          </Grid.ColumnDefinitions> 
                          <Button Grid.Column="0" Content="X" Height="20" Width="20" commands:Click.Command="{Binding CloseCommand}" commands:Click.CommandParameter="{Binding ScreenTag}" Style="{StaticResource CloseTabButtonStyle}" Margin="2,0,0,0" /> 
                          <telerikPrimitives:TabItemContentPresenter Grid.Column="1" 
                                        x:Name="HeaderElement" Foreground="{TemplateBinding Foreground}"   
                                        HorizontalAlignment="Center" Margin="{TemplateBinding Padding}"   
                                        VerticalAlignment="Center" Content="{Binding HeaderInfo}"/>  
                        </Grid> 
                      </layoutToolkit:LayoutTransformer> 
                    </Grid> 
                  </ControlTemplate> 
                </Setter.Value> 
              </Setter> 
            </Style> 
          </infRegionAdapters:RadTabControlRegionAdapter.ItemContainerStyle> 
    Private Shared Function PrepareContainerForItem(ByVal item As Object, ByVal parent As DependencyObject) As RadTabItem  
            Dim container As RadTabItem = TryCast(item, RadTabItem)  
            If container Is Nothing Then  
              container = New RadTabItem()  
              container.Content = item 
              container.DataContext = GetDataContext(item)  
              container.Style = GetItemContainerStyle(parent)  
                        container.SetValue(IsGeneratedProperty, True)  
                        If container.Header IsNot Nothing Then  
                            containercontainer.Header = container.HeaderTemplate.LoadContent()  
                        End If  
                    End If  
     
                    Return container  
          End Function 

    can anyone please help out?
    Thanks!
  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 13 Nov 2009 Link to this post

    Hi tmorford,

    There are two ways to display this property. If you are using a template for your headers, you may reuse it, by assigning it to the ItemDropDownContentTemplate property of the TabCotnrol like so:

    ItemDropDownContentTemplate="{StaticResource HeaderTemplate}"

    Alternatively you may set the DropDownDisplayMemberPath property if the HeaderInfo value is a string, like so:

    DropDownDisplayMemberPath="HeaderInfo"

    All the best,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top