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

Vertical Tab DropDownDisplayMode showing Telerik.Windows.Controls.RadTabItem

1 Answer 99 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
tmorford
Top achievements
Rank 1
tmorford asked on 10 Nov 2009, 02:54 PM
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!

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 13 Nov 2009, 04:14 PM
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.
Tags
TabControl
Asked by
tmorford
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or