Class RadTabControl
A navigation control used to create tabbed interface.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
[TelerikToolboxCategory("Navigation")]
[Themable]
public class RadTabControl : RadTabControlBase, IThemable
Remarks
The RadTabControl is used to create a list of tabs. It is System.Windows.Controls.ItemsControl and its default items are of type RadTabItem.
Constructors
RadTabControl()
Initializes a new instance of the RadTabControl class.
Declaration
public RadTabControl()
Remarks
Use this constructor to create an instance of the RadTabControl. In order for the TabControl to be displayed, you need to add it to the visual tree.
The Following examples show how you can create an instance of the RadTabControl control.
<telerik:RadTabControl>
<telerik:RadTabItem Header="Tab 1"/>
</telerik:RadTabControl>
RadTabControl tabControl = new RadTabControl();
tabControl.Items.Add(new RadTabItem(){Header="Tab 1", Content="Tab Content"});
Fields
AdditionalContentProperty
Identifies the AdditionalContent property.
Declaration
public static readonly DependencyProperty AdditionalContentProperty
Field Value
System.Windows.DependencyProperty
|
AlignProperty
Identifies the Align property.
Declaration
public static readonly DependencyProperty AlignProperty
Field Value
System.Windows.DependencyProperty
|
AllowDragOverTabProperty
Identifies the AllowDragOverTab property.
Declaration
public static readonly DependencyProperty AllowDragOverTabProperty
Field Value
System.Windows.DependencyProperty
|
AllowDragReorderProperty
Identifies the AllowDragReorder property.
Declaration
public static readonly DependencyProperty AllowDragReorderProperty
Field Value
System.Windows.DependencyProperty
|
AllTabsEqualHeightProperty
Identifies the AllTabsEqualHeight property.
Declaration
public static readonly DependencyProperty AllTabsEqualHeightProperty
Field Value
System.Windows.DependencyProperty
|
See Also
BottomTemplateProperty
Identifies the BottomTemplate property.
Declaration
public static readonly DependencyProperty BottomTemplateProperty
Field Value
System.Windows.DependencyProperty
|
CloseTabsOnMouseMiddleButtonDownProperty
Identifies the CloseTabsOnMouseMiddleButtonDown property.
Declaration
public static readonly DependencyProperty CloseTabsOnMouseMiddleButtonDownProperty
Field Value
System.Windows.DependencyProperty
|
DropDownButtonStyleProperty
Identifies the DropDownButtonStyle property.
Declaration
public static readonly DependencyProperty DropDownButtonStyleProperty
Field Value
System.Windows.DependencyProperty
|
DropDownDisplayMemberPathProperty
Identifies the DropDownDisplayMemberPath property.
Declaration
public static readonly DependencyProperty DropDownDisplayMemberPathProperty
Field Value
System.Windows.DependencyProperty
|
DropDownDisplayModeProperty
Identifies the DropDownDisplayMode property.
Declaration
public static readonly DependencyProperty DropDownDisplayModeProperty
Field Value
System.Windows.DependencyProperty
|
DropDownStyleProperty
Identifies the DropDownStyle property.
Declaration
public static readonly DependencyProperty DropDownStyleProperty
Field Value
System.Windows.DependencyProperty
|
InvertMouseWheelScrollDirectionProperty
Identifies the InvertMouseWheelScrollDirection property.
Declaration
public static readonly DependencyProperty InvertMouseWheelScrollDirectionProperty
Field Value
System.Windows.DependencyProperty
|
IsDropDownOpenProperty
Identifies the IsDropDownOpen property.
Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
System.Windows.DependencyProperty
|
ItemDropDownContentTemplateProperty
Identifies the ItemDropDownContentTemplate property.
Declaration
public static readonly DependencyProperty ItemDropDownContentTemplateProperty
Field Value
System.Windows.DependencyProperty
|
ItemDropDownContentTemplateSelectorProperty
Identifies the ItemDropDownContentTemplateSelector property.
Declaration
public static readonly DependencyProperty ItemDropDownContentTemplateSelectorProperty
Field Value
System.Windows.DependencyProperty
|
ItemReorderedEvent
Identifies the ItemReordered routed event.
Declaration
public static readonly RoutedEvent ItemReorderedEvent
Field Value
System.Windows.RoutedEvent
|
LeftTemplateProperty
Identifies the LeftTemplate property.
Declaration
public static readonly DependencyProperty LeftTemplateProperty
Field Value
System.Windows.DependencyProperty
|
OverflowModeProperty
Identifies the OverflowModeProperty property.
Declaration
public static readonly DependencyProperty OverflowModeProperty
Field Value
System.Windows.DependencyProperty
|
PreviewTabClosedEvent
Registers the PreviewTabClosed routed event.
Declaration
public static readonly RoutedEvent PreviewTabClosedEvent
Field Value
System.Windows.RoutedEvent
|
PreviewTabPinnedEvent
Registers the PreviewTabPinned routed event.
Declaration
public static readonly RoutedEvent PreviewTabPinnedEvent
Field Value
System.Windows.RoutedEvent
|
PreviewTabUnpinnedEvent
Registers the PreviewTabUnpinned routed event.
Declaration
public static readonly RoutedEvent PreviewTabUnpinnedEvent
Field Value
System.Windows.RoutedEvent
|
RightTemplateProperty
Identifies the RightTemplate property.
Declaration
public static readonly DependencyProperty RightTemplateProperty
Field Value
System.Windows.DependencyProperty
|
ScrollModeProperty
Identifies the ScrollModeProperty property.
Declaration
public static readonly DependencyProperty ScrollModeProperty
Field Value
System.Windows.DependencyProperty
|
TabClosedEvent
Registers the TabClosed routed event.
Declaration
public static readonly RoutedEvent TabClosedEvent
Field Value
System.Windows.RoutedEvent
|
TabOrientationProperty
Identifies the TabOrientation property.
Declaration
public static readonly DependencyProperty TabOrientationProperty
Field Value
System.Windows.DependencyProperty
|
TabPinnedEvent
Registers the TabPinned routed event.
Declaration
public static readonly RoutedEvent TabPinnedEvent
Field Value
System.Windows.RoutedEvent
|
TabStripPlacementProperty
Identifies the TabStripPlacement property.
Declaration
public static readonly DependencyProperty TabStripPlacementProperty
Field Value
System.Windows.DependencyProperty
|
TabUnpinnedEvent
Registers the TabUnpinned routed event.
Declaration
public static readonly RoutedEvent TabUnpinnedEvent
Field Value
System.Windows.RoutedEvent
|
TopTemplateProperty
Identifies the TopTemplate property.
Declaration
public static readonly DependencyProperty TopTemplateProperty
Field Value
System.Windows.DependencyProperty
|
Properties
AdditionalContent
Identifies the AdditionalContent property.
Declaration
public object AdditionalContent { get; set; }
Property Value
System.Object
|
Align
Gets or sets the alignment of the tab items in the row - Left, Right, Center, Justify. This is a dependency property.
Declaration
[SRDescription("TabControlAlignDescription")]
[SRCategory("AppearanceCategory")]
public TabStripAlign Align { get; set; }
Property Value
TabStripAlign
|
Remarks
The Align property arranges the tab items in the preferred way - Left, Right, Center or Justify.
If Align Justify is selected, the items would be scaled proportionally all the to fill the available space.
If not enough space is available (i.e. the desired width of the row of tab items is more than the available space), then the tab items are arranged as if "Justify" is chosen. Unlike the WPF tab control behaviour the tab items would not automatically move to the next row if there is not enough space, instead their width is reduced and parts of them can be clipped.
If you would like to create a multi row tab control, please use the IsBreak property of the tab item.
The default value is Left.
See Also
AllowDragOverTab
Gets or sets a value indicating whether dragging objects over a tab item will select this TabItem. This is a dependency property.
Declaration
[SRCategory("Behavior")]
public bool AllowDragOverTab { get; set; }
Property Value
System.Boolean
|
Remarks
The DragOverTab feature will work only if the RadDragAndDropManager is used.
The default value is false.
AllowDragReorder
Gets or sets a value indicating whether the user will be able to rearrange the tabs with dragging. This is a dependency property.
Declaration
[SRCategory("Behavior")]
public bool AllowDragReorder { get; set; }
Property Value
System.Boolean
|
Remarks
The default value is false.
AllTabsEqualHeight
Gets or sets whether all displayed tabs have equal height. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlAllTabsEqualHeightDescription")]
public bool AllTabsEqualHeight { get; set; }
Property Value
System.Boolean
|
Remarks
The AllTabsEqualHeight property governs the arranging behaviour of the TabStrip when TabItems with different height are present.
If you have multiline TabItems for example, setting the property to True would ensure that all the TabItems have the same height.
Please note that the adjustment of height takes place on a row-per-row basis, i.e. in a two-row TabStrip the height of the TabItems would be equal to the height of the highest item in each row and might be different.
The default value is true.
BottomTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Bottom. This is a dependency property.
Declaration
[SRCategory("Appearance")]
[SRDescription("TabControlBottomTemplateDescription")]
public ControlTemplate BottomTemplate { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Remarks
For more information, please see TopTemplate property.
CloseTabsOnMouseMiddleButtonDown
Gets or sets a value indicating whether user can close tabs by clicking the mouse middle button over a particular RadTabItem.
Declaration
public bool CloseTabsOnMouseMiddleButtonDown { get; set; }
Property Value
System.Boolean
|
DropDownButtonStyle
Gets or sets the style for the Telerik.Windows.Controls.RadTabControl.DropDownMenu toggle button in the ControlTemplate of the tab control. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public Style DropDownButtonStyle { get; set; }
Property Value
System.Windows.Style
|
DropDownDisplayMemberPath
Gets or sets the name of property that will be used to display tab items in the Telerik.Windows.Controls.RadTabControl.DropDownMenu. This is a dependency property.
Declaration
public string DropDownDisplayMemberPath { get; set; }
Property Value
System.String
|
DropDownDisplayMode
Gets or sets when the Telerik.Windows.Controls.RadTabControl.DropDownMenu button should be displayed: always, never, when needed. This is a dependency property.
Declaration
public TabControlDropDownDisplayMode DropDownDisplayMode { get; set; }
Property Value
TabControlDropDownDisplayMode
|
DropDownStyle
Gets or sets the style for the Telerik.Windows.Controls.RadTabControl.DropDownMenu of the tab control. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public Style DropDownStyle { get; set; }
Property Value
System.Windows.Style
|
InvertMouseWheelScrollDirection
Inverts the scrolling direction when using the mouse wheel over the tab strip panel.
Declaration
public bool InvertMouseWheelScrollDirection { get; set; }
Property Value
System.Boolean
|
IsDropDownOpen
Gets or sets a value indicating whether the Telerik.Windows.Controls.RadTabControl.DropDownMenu of the tab control is open. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public bool IsDropDownOpen { get; set; }
Property Value
System.Boolean
|
ItemDropDownContentTemplate
Gets or sets the System.Windows.DataTemplate that will be used to display the items in the drop down menu if they do not have a ItemDropDownContentTemplateSelector. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public DataTemplate ItemDropDownContentTemplate { get; set; }
Property Value
System.Windows.DataTemplate
|
ItemDropDownContentTemplateSelector
Gets or sets the DataTemplateSelector that will be used to display the items in the drop down menu if they do not have a ItemDropDownContentTemplate. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public DataTemplateSelector ItemDropDownContentTemplateSelector { get; set; }
Property Value
System.Windows.Controls.DataTemplateSelector
|
LeftTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Left. This is a dependency property.
Declaration
[SRCategory("Appearance")]
[SRDescription("TabControlLeftTemplateDescription")]
public ControlTemplate LeftTemplate { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Remarks
For more information, please see TopTemplate property.
OverflowMode
Gets or sets what happens when the width of the tab items exceeds the available width. They will either scroll or wrap.
Declaration
public TabOverflowMode OverflowMode { get; set; }
Property Value
TabOverflowMode
|
PinnedItems
Gets the collection of currently pinned RadTabItems.
Declaration
public ReadOnlyObservableCollection<RadTabItem> PinnedItems { get; }
Property Value
System.Collections.ObjectModel.ReadOnlyObservableCollection<RadTabItem>
|
RightTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Right. This is a dependency property.
Declaration
[SRCategory("Appearance")]
[SRDescription("TabControlRightTemplateDescription")]
public ControlTemplate RightTemplate { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Remarks
For more information, please see TopTemplate property.
ScrollMode
Gets or sets the type of scrolling that will occur when the user presses the scroll buttons. This is a dependency property.
Declaration
public TabControlScrollMode ScrollMode { get; set; }
Property Value
TabControlScrollMode
|
TabOrientation
Gets or sets the orientation of the TabItems in the TabControl. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlTabOrientationDescription")]
public Orientation TabOrientation { get; set; }
Property Value
System.Windows.Controls.Orientation
|
Remarks
The TabOrientation property allows you to set the orientation of the tab items.
The default value is
The following examples show how TabOrientation can be set:
Please note that you need the telerik namespace to be defined in your XAML.
TabStripPlacement
Gets or sets the position of the tab strip with regard to the content. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlTabStripPlacementDescription")]
public Dock TabStripPlacement { get; set; }
Property Value
System.Windows.Controls.Dock
|
Remarks
The TabStripPlacement property allows you to change where the tab strip (i.e. the buttons) would appear relative to the content.
Please note that changing the TabStripPlacement changes the ControlTemplate of the tab items. To achieve a consistent look when a custom theme is created, ControlTemplates for the four positions should be provided.
The default value is Top.
TopTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Top. This is a dependency property.
Declaration
[SRCategory("Appearance")]
[SRDescription("TabControlTopTemplateDescription")]
public ControlTemplate TopTemplate { get; set; }
Property Value
System.Windows.Controls.ControlTemplate
|
Remarks
There are four properties that set the templates of the TabControl: TopTemplate, BottomTemplate, LeftTemplate and RightTemplate. These templates will be used when the TabStripPlacement is changed. Please note that if these properties are set to null, the default templates will be used.
In order to set the templates for the tab items, the respective tab item properties should be used. If the tab items are generated (System.Windows.Controls.ItemsControl.ItemsSource is used) the ItemContainerStyle can be used to set the templates.
Methods
ChangeVisualState(Boolean)
Updates the visual states of the control.
Declaration
protected override void ChangeVisualState(bool useTransitions)
Parameters
System.Boolean
useTransitions
Identifies whether the transitions should be used. |
Overrides
ClearContainerForItemOverride(DependencyObject, Object)
When overridden in a derived class, undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
The container element. |
System.Object
item
The item. |
FindTemplateFromPosition(Dock)
Returns a template for the given position of the tab strip.
Declaration
protected virtual ControlTemplate FindTemplateFromPosition(Dock position)
Parameters
System.Windows.Controls.Dock
position
The position for which a template is requested. |
Returns
System.Windows.Controls.ControlTemplate
An instance of the template for the given position. |
GetContainer()
Returns a new instance of the control that implements the IRadTabItem interface.
Declaration
protected override IRadTabItem GetContainer()
Returns
IRadTabItem
|
Overrides
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Creates a Telerik.Windows.Controls.RadTabControlAutomationPeer peer associated with this object.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
An instance of the Telerik.Windows.Controls.RadTabControlAutomationPeer. |
OnDropDownMenuItemClick(Object, RoutedEventArgs)
Called when a Telerik.Windows.Controls.RadTabControl.DropDownMenu menu item has been clicked.
Declaration
protected virtual void OnDropDownMenuItemClick(object sender, RoutedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
System.Windows.RoutedEventArgs
e
The arguments of the event. |
OnInitialized(EventArgs)
Raises the System.Windows.FrameworkElement.Initialized event. This method is invoked whenever System.Windows.FrameworkElement.IsInitialized is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
System.EventArgs
e
The System.Windows.RoutedEventArgs that contains the event data. |
OnIsDropDownOpenChanged(Boolean, Boolean)
Called when the IsDropDownOpen property changes.
Declaration
protected virtual void OnIsDropDownOpenChanged(bool oldValue, bool newValue)
Parameters
System.Boolean
oldValue
The old value of the property. |
System.Boolean
newValue
The new value of the property. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
Information about the change. |
OnItemsPanelChanged(ItemsPanelTemplate, ItemsPanelTemplate)
Invoked when the System.Windows.Controls.ItemsControl.ItemsPanel property changes.
Declaration
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
Parameters
System.Windows.Controls.ItemsPanelTemplate
oldItemsPanel
Old value of the ItemsControl.ItemsPanel property. |
System.Windows.Controls.ItemsPanelTemplate
newItemsPanel
New value of the ItemsControl.ItemsPanel property. |
OnLeftScrollButtonClick(Object, RoutedEventArgs)
Invoked when the left scroll button has been clicked.
Declaration
protected virtual void OnLeftScrollButtonClick(object sender, RoutedEventArgs e)
Parameters
System.Object
sender
|
System.Windows.RoutedEventArgs
e
|
OnPreviewTabClosed(PreviewTabChangedEventArgs)
Raises the PreviewTabClosed event.
Declaration
protected virtual bool OnPreviewTabClosed(PreviewTabChangedEventArgs args)
Parameters
PreviewTabChangedEventArgs
args
The PreviewTabChangedEventArgs instance containing the event data. |
Returns
System.Boolean
|
OnPreviewTabPinned(PreviewTabChangedEventArgs)
Raises the PreviewTabPinned event.
Declaration
protected virtual bool OnPreviewTabPinned(PreviewTabChangedEventArgs args)
Parameters
PreviewTabChangedEventArgs
args
The PreviewTabChangedEventArgs instance containing the event data. |
Returns
System.Boolean
|
OnPreviewTabUnpinned(PreviewTabChangedEventArgs)
Raises the PreviewTabUnpinned event.
Declaration
protected virtual bool OnPreviewTabUnpinned(PreviewTabChangedEventArgs args)
Parameters
PreviewTabChangedEventArgs
args
The PreviewTabChangedEventArgs instance containing the event data. |
Returns
System.Boolean
|
OnRightScrollButtonClick(Object, RoutedEventArgs)
Invoked when the right scroll button has been clicked.
Declaration
protected virtual void OnRightScrollButtonClick(object sender, RoutedEventArgs e)
Parameters
System.Object
sender
|
System.Windows.RoutedEventArgs
e
|
OnScrollButtonsVisibilityChanged()
Invoked when scroll buttons visibility changes.
Declaration
protected virtual void OnScrollButtonsVisibilityChanged()
OnSelectionChanged(RadSelectionChangedEventArgs)
Raises the SelectionChanged routed event and selection automation events.
Declaration
protected override void OnSelectionChanged(RadSelectionChangedEventArgs e)
Parameters
RadSelectionChangedEventArgs
e
|
Overrides
OnTabClosed(TabChangedEventArgs)
Raises the TabClosed event.
Declaration
protected virtual void OnTabClosed(TabChangedEventArgs args)
Parameters
TabChangedEventArgs
args
The TabChangedEventArgs instance containing the event data. |
OnTabPinned(TabChangedEventArgs)
Raises the TabPinned event.
Declaration
protected virtual void OnTabPinned(TabChangedEventArgs args)
Parameters
TabChangedEventArgs
args
The TabChangedEventArgs instance containing the event data. |
OnTabUnpinned(TabChangedEventArgs)
Raises the TabUnpinned event.
Declaration
protected virtual void OnTabUnpinned(TabChangedEventArgs args)
Parameters
TabChangedEventArgs
args
The TabChangedEventArgs instance containing the event data. |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
Element used to display the specified item. |
System.Object
item
Specified item. |
ScrollIntoView(Object)
Scrolls the container of given item into view.
Declaration
public void ScrollIntoView(object item)
Parameters
System.Object
item
The item to scroll into view. |
UpdateSelectedContentProperties()
Updates the selected content properties SelectedContent, SelectedContentTemplate and SelectedContentTemplateSelector. Selected content properties are used when representing the content of selected tab item.
Declaration
protected override void UpdateSelectedContentProperties()
Overrides
UpdateTabStrip()
Updates the tab strip.
Declaration
protected void UpdateTabStrip()
Events
ItemReordered
Occurs when a item is reordered while dragging. This is a RoutedEvent.
Declaration
public virtual event ItemReorderedEventHandler ItemReordered
Event Type
ItemReorderedEventHandler
|
PreviewTabClosed
Occurs when a RadTabItem is about to be closed.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabClosed
Event Type
System.EventHandler<PreviewTabChangedEventArgs>
|
PreviewTabPinned
Occurs when a RadTabItem is about to be pinned.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabPinned
Event Type
System.EventHandler<PreviewTabChangedEventArgs>
|
PreviewTabUnpinned
Occurs when a RadTabItem is about to be unpinned.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabUnpinned
Event Type
System.EventHandler<PreviewTabChangedEventArgs>
|
TabClosed
Occurs when a RadTabItem is closed.
Declaration
public event EventHandler<TabChangedEventArgs> TabClosed
Event Type
System.EventHandler<TabChangedEventArgs>
|
TabPinned
Occurs when a RadTabItem is pinned.
Declaration
public event EventHandler<TabChangedEventArgs> TabPinned
Event Type
System.EventHandler<TabChangedEventArgs>
|
TabUnpinned
Occurs when a RadTabItem is unpinned.
Declaration
public event EventHandler<TabChangedEventArgs> TabUnpinned
Event Type
System.EventHandler<TabChangedEventArgs>
|