ClassRadTabControl
A navigation control used to create tabbed interface.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Navigation.dll
Syntax:
[TelerikToolboxCategory("Navigation")]
[Themable]
public class RadTabControl : RadTabControlBase
Inheritance: objectRadTabControlBaseRadTabControl
Derived Classes:
Inherited Members
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.
<pre><code class="lang-csharp"><telerik:RadTabControl>
<telerik:RadTabItem Header="Tab 1"/>
</telerik:RadTabControl></code></pre>
<pre><code class="lang-csharp">RadTabControl tabControl = new RadTabControl();
tabControl.Items.Add(new RadTabItem(){Header="Tab 1", Content="Tab Content"});</code></pre>
Fields
AdditionalContentProperty
Identifies the AdditionalContent property.
Declaration
public static readonly DependencyProperty AdditionalContentProperty
Field Value
DependencyProperty
AlignProperty
Identifies the Align property.
Declaration
public static readonly DependencyProperty AlignProperty
Field Value
DependencyProperty
AllTabsEqualHeightProperty
Identifies the AllTabsEqualHeight property.
Declaration
public static readonly DependencyProperty AllTabsEqualHeightProperty
Field Value
DependencyProperty
AllowDragOverTabProperty
Identifies the AllowDragOverTab property.
Declaration
public static readonly DependencyProperty AllowDragOverTabProperty
Field Value
DependencyProperty
AllowDragReorderProperty
Identifies the AllowDragReorder property.
Declaration
public static readonly DependencyProperty AllowDragReorderProperty
Field Value
DependencyProperty
BottomTemplateProperty
Identifies the BottomTemplate property.
Declaration
public static readonly DependencyProperty BottomTemplateProperty
Field Value
DependencyProperty
CloseTabsOnMouseMiddleButtonDownProperty
Identifies the CloseTabsOnMouseMiddleButtonDown property.
Declaration
public static readonly DependencyProperty CloseTabsOnMouseMiddleButtonDownProperty
Field Value
DependencyProperty
DropDownButtonStyleProperty
Identifies the DropDownButtonStyle property.
Declaration
public static readonly DependencyProperty DropDownButtonStyleProperty
Field Value
DependencyProperty
DropDownDisplayMemberPathProperty
Identifies the DropDownDisplayMemberPath property.
Declaration
public static readonly DependencyProperty DropDownDisplayMemberPathProperty
Field Value
DependencyProperty
DropDownDisplayModeProperty
Identifies the DropDownDisplayMode property.
Declaration
public static readonly DependencyProperty DropDownDisplayModeProperty
Field Value
DependencyProperty
DropDownStyleProperty
Identifies the DropDownStyle property.
Declaration
public static readonly DependencyProperty DropDownStyleProperty
Field Value
DependencyProperty
InvertMouseWheelScrollDirectionProperty
Identifies the InvertMouseWheelScrollDirection property.
Declaration
public static readonly DependencyProperty InvertMouseWheelScrollDirectionProperty
Field Value
DependencyProperty
IsDropDownOpenProperty
Identifies the IsDropDownOpen property.
Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
DependencyProperty
ItemDropDownContentTemplateProperty
Identifies the ItemDropDownContentTemplate property.
Declaration
public static readonly DependencyProperty ItemDropDownContentTemplateProperty
Field Value
DependencyProperty
ItemDropDownContentTemplateSelectorProperty
Identifies the ItemDropDownContentTemplateSelector property.
Declaration
public static readonly DependencyProperty ItemDropDownContentTemplateSelectorProperty
Field Value
DependencyProperty
ItemReorderedEvent
Identifies the ItemReordered routed event.
Declaration
public static readonly RoutedEvent ItemReorderedEvent
Field Value
RoutedEvent
LeftTemplateProperty
Identifies the LeftTemplate property.
Declaration
public static readonly DependencyProperty LeftTemplateProperty
Field Value
DependencyProperty
OverflowModeProperty
Identifies the OverflowModeProperty property.
Declaration
public static readonly DependencyProperty OverflowModeProperty
Field Value
DependencyProperty
PreviewTabClosedEvent
Registers the PreviewTabClosed routed event.
Declaration
public static readonly RoutedEvent PreviewTabClosedEvent
Field Value
RoutedEvent
PreviewTabPinnedEvent
Registers the PreviewTabPinned routed event.
Declaration
public static readonly RoutedEvent PreviewTabPinnedEvent
Field Value
RoutedEvent
PreviewTabUnpinnedEvent
Registers the PreviewTabUnpinned routed event.
Declaration
public static readonly RoutedEvent PreviewTabUnpinnedEvent
Field Value
RoutedEvent
RightTemplateProperty
Identifies the RightTemplate property.
Declaration
public static readonly DependencyProperty RightTemplateProperty
Field Value
DependencyProperty
ScrollModeProperty
Identifies the ScrollModeProperty property.
Declaration
public static readonly DependencyProperty ScrollModeProperty
Field Value
DependencyProperty
TabClosedEvent
Registers the TabClosed routed event.
Declaration
public static readonly RoutedEvent TabClosedEvent
Field Value
RoutedEvent
TabOrientationProperty
Identifies the TabOrientation property.
Declaration
public static readonly DependencyProperty TabOrientationProperty
Field Value
DependencyProperty
TabPinnedEvent
Registers the TabPinned routed event.
Declaration
public static readonly RoutedEvent TabPinnedEvent
Field Value
RoutedEvent
TabStripPlacementProperty
Identifies the TabStripPlacement property.
Declaration
public static readonly DependencyProperty TabStripPlacementProperty
Field Value
DependencyProperty
TabUnpinnedEvent
Registers the TabUnpinned routed event.
Declaration
public static readonly RoutedEvent TabUnpinnedEvent
Field Value
RoutedEvent
TopTemplateProperty
Identifies the TopTemplate property.
Declaration
public static readonly DependencyProperty TopTemplateProperty
Field Value
DependencyProperty
Properties
AdditionalContent
Identifies the AdditionalContent property.
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
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.
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
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.
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
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
Remarks
The default value is false.
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
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
DropDownButtonStyle
Gets or sets the style for the toggle button in the ControlTemplate of the tab control. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public Style DropDownButtonStyle { get; set; }
Property Value
Style
DropDownDisplayMemberPath
Gets or sets the name of property that will be used to display tab items in the . This is a dependency property.
Declaration
public string DropDownDisplayMemberPath { get; set; }
Property Value
DropDownDisplayMode
Gets or sets when the button should be displayed: always, never, when needed. This is a dependency property.
Declaration
public TabControlDropDownDisplayMode DropDownDisplayMode { get; set; }
Property Value
DropDownStyle
Gets or sets the style for the of the tab control. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public Style DropDownStyle { get; set; }
Property Value
Style
InvertMouseWheelScrollDirection
Inverts the scrolling direction when using the mouse wheel over the tab strip panel.
Declaration
public bool InvertMouseWheelScrollDirection { get; set; }
Property Value
IsDropDownOpen
Gets or sets a value indicating whether the of the tab control is open. This is a dependency property.
Declaration
[SRCategory("AppearanceCategory")]
public bool IsDropDownOpen { get; set; }
Property Value
ItemDropDownContentTemplate
Gets or sets the 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
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
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
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
PinnedItems
Gets the collection of currently pinned RadTabItems.
Declaration
public ReadOnlyObservableCollection<RadTabItem> PinnedItems { get; }
Property Value
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
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
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
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
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
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 ( is used) the ItemContainerStyle can be used to set the templates.
Methods
ChangeVisualState(bool)
Updates the visual states of the control.
Declaration
protected override void ChangeVisualState(bool useTransitions)
Parameters
useTransitions
Identifies whether the transitions should be used.
Overrides
ClearContainerForItemOverride(DependencyObject, object)
When overridden in a derived class, undoes the effects of the method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
element
DependencyObject
The container element.
item
The item.
FindTemplateFromPosition(Dock)
Returns a template for the given position of the tab strip.
Declaration
protected virtual ControlTemplate FindTemplateFromPosition(Dock position)
Parameters
position
Dock
The position for which a template is requested.
Returns
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
Overrides
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Creates a peer associated with this object.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
An instance of the .
OnDropDownMenuItemClick(object, RoutedEventArgs)
Called when a menu item has been clicked.
Declaration
[SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", Justification = "There is no need to make the method private.")]
protected virtual void OnDropDownMenuItemClick(object sender, RoutedEventArgs e)
Parameters
sender
The sender of the event.
e
RoutedEventArgs
The arguments of the event.
OnInitialized(EventArgs)
Raises the event. This method is invoked whenever is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
OnIsDropDownOpenChanged(bool, bool)
Called when the IsDropDownOpen property changes.
OnItemsChanged(NotifyCollectionChangedEventArgs)
Invoked when the property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
e
NotifyCollectionChangedEventArgs
Information about the change.
OnItemsPanelChanged(ItemsPanelTemplate, ItemsPanelTemplate)
Invoked when the property changes.
Declaration
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
Parameters
oldItemsPanel
ItemsPanelTemplate
Old value of the property.
newItemsPanel
ItemsPanelTemplate
New value of the property.
OnLeftScrollButtonClick(object, RoutedEventArgs)
Invoked when the left scroll button has been clicked.
Declaration
protected virtual void OnLeftScrollButtonClick(object sender, RoutedEventArgs e)
Parameters
sender
e
RoutedEventArgs
OnPreviewTabClosed(PreviewTabChangedEventArgs)
Raises the event.
Declaration
protected virtual bool OnPreviewTabClosed(PreviewTabChangedEventArgs args)
Parameters
args
The PreviewTabChangedEventArgs instance containing the event data.
Returns
OnPreviewTabPinned(PreviewTabChangedEventArgs)
Raises the event.
Declaration
protected virtual bool OnPreviewTabPinned(PreviewTabChangedEventArgs args)
Parameters
args
The PreviewTabChangedEventArgs instance containing the event data.
Returns
OnPreviewTabUnpinned(PreviewTabChangedEventArgs)
Raises the event.
Declaration
protected virtual bool OnPreviewTabUnpinned(PreviewTabChangedEventArgs args)
Parameters
args
The PreviewTabChangedEventArgs instance containing the event data.
Returns
OnRightScrollButtonClick(object, RoutedEventArgs)
Invoked when the right scroll button has been clicked.
Declaration
protected virtual void OnRightScrollButtonClick(object sender, RoutedEventArgs e)
Parameters
sender
e
RoutedEventArgs
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
e
Overrides
OnTabClosed(TabChangedEventArgs)
Raises the event.
Declaration
protected virtual void OnTabClosed(TabChangedEventArgs args)
Parameters
args
The TabChangedEventArgs instance containing the event data.
OnTabPinned(TabChangedEventArgs)
Raises the event.
Declaration
protected virtual void OnTabPinned(TabChangedEventArgs args)
Parameters
args
The TabChangedEventArgs instance containing the event data.
OnTabUnpinned(TabChangedEventArgs)
Raises the event.
Declaration
protected virtual void OnTabUnpinned(TabChangedEventArgs args)
Parameters
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
element
DependencyObject
Element used to display the specified item.
item
Specified item.
ScrollIntoView(object)
Scrolls the container of given item into view.
Declaration
public void ScrollIntoView(object item)
Parameters
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
Events
ItemReordered
Occurs when a item is reordered while dragging. This is a RoutedEvent.
Declaration
public virtual event ItemReorderedEventHandler ItemReordered
Event Value
PreviewTabClosed
Occurs when a RadTabItem is about to be closed.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabClosed
Event Value
PreviewTabPinned
Occurs when a RadTabItem is about to be pinned.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabPinned
Event Value
PreviewTabUnpinned
Occurs when a RadTabItem is about to be unpinned.
Declaration
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabUnpinned
Event Value
TabClosed
Occurs when a RadTabItem is closed.
Declaration
public event EventHandler<TabChangedEventArgs> TabClosed
Event Value
TabPinned
Occurs when a RadTabItem is pinned.
Declaration
public event EventHandler<TabChangedEventArgs> TabPinned
Event Value
TabUnpinned
Occurs when a RadTabItem is unpinned.
Declaration
public event EventHandler<TabChangedEventArgs> TabUnpinned
Event Value