RadTabControl
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
Initializes a new instance of the RadTabControl class.
public RadTabControl()
<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
DependencyProperty
Identifies the AdditionalContent property.
public static readonly DependencyProperty AdditionalContentProperty
AlignProperty
DependencyProperty
Identifies the Align property.
public static readonly DependencyProperty AlignProperty
AllowDragOverTabProperty
DependencyProperty
Identifies the AllowDragOverTab property.
public static readonly DependencyProperty AllowDragOverTabProperty
AllowDragReorderProperty
DependencyProperty
Identifies the AllowDragReorder property.
public static readonly DependencyProperty AllowDragReorderProperty
AllTabsEqualHeightProperty
DependencyProperty
Identifies the AllTabsEqualHeight property.
public static readonly DependencyProperty AllTabsEqualHeightProperty
BottomTemplateProperty
DependencyProperty
Identifies the BottomTemplate property.
public static readonly DependencyProperty BottomTemplateProperty
CloseTabsOnMouseMiddleButtonDownProperty
DependencyProperty
Identifies the CloseTabsOnMouseMiddleButtonDown property.
public static readonly DependencyProperty CloseTabsOnMouseMiddleButtonDownProperty
DropDownButtonStyleProperty
DependencyProperty
Identifies the DropDownButtonStyle property.
public static readonly DependencyProperty DropDownButtonStyleProperty
DropDownDisplayMemberPathProperty
DependencyProperty
Identifies the DropDownDisplayMemberPath property.
public static readonly DependencyProperty DropDownDisplayMemberPathProperty
DropDownDisplayModeProperty
DependencyProperty
Identifies the DropDownDisplayMode property.
public static readonly DependencyProperty DropDownDisplayModeProperty
DropDownStyleProperty
DependencyProperty
Identifies the DropDownStyle property.
public static readonly DependencyProperty DropDownStyleProperty
InvertMouseWheelScrollDirectionProperty
DependencyProperty
Identifies the InvertMouseWheelScrollDirection property.
public static readonly DependencyProperty InvertMouseWheelScrollDirectionProperty
IsDropDownOpenProperty
DependencyProperty
Identifies the IsDropDownOpen property.
public static readonly DependencyProperty IsDropDownOpenProperty
ItemDropDownContentTemplateProperty
DependencyProperty
Identifies the ItemDropDownContentTemplate property.
public static readonly DependencyProperty ItemDropDownContentTemplateProperty
ItemDropDownContentTemplateSelectorProperty
DependencyProperty
Identifies the ItemDropDownContentTemplateSelector property.
public static readonly DependencyProperty ItemDropDownContentTemplateSelectorProperty
ItemReorderedEvent
RoutedEvent
Identifies the ItemReordered routed event.
public static readonly RoutedEvent ItemReorderedEvent
LeftTemplateProperty
DependencyProperty
Identifies the LeftTemplate property.
public static readonly DependencyProperty LeftTemplateProperty
OverflowModeProperty
DependencyProperty
Identifies the OverflowModeProperty property.
public static readonly DependencyProperty OverflowModeProperty
PreviewTabClosedEvent
RoutedEvent
Registers the PreviewTabClosed routed event.
public static readonly RoutedEvent PreviewTabClosedEvent
PreviewTabPinnedEvent
RoutedEvent
Registers the PreviewTabPinned routed event.
public static readonly RoutedEvent PreviewTabPinnedEvent
PreviewTabUnpinnedEvent
RoutedEvent
Registers the PreviewTabUnpinned routed event.
public static readonly RoutedEvent PreviewTabUnpinnedEvent
RightTemplateProperty
DependencyProperty
Identifies the RightTemplate property.
public static readonly DependencyProperty RightTemplateProperty
ScrollModeProperty
DependencyProperty
Identifies the ScrollModeProperty property.
public static readonly DependencyProperty ScrollModeProperty
TabClosedEvent
RoutedEvent
Registers the TabClosed routed event.
public static readonly RoutedEvent TabClosedEvent
TabOrientationProperty
DependencyProperty
Identifies the TabOrientation property.
public static readonly DependencyProperty TabOrientationProperty
TabPinnedEvent
RoutedEvent
Registers the TabPinned routed event.
public static readonly RoutedEvent TabPinnedEvent
TabStripPlacementProperty
DependencyProperty
Identifies the TabStripPlacement property.
public static readonly DependencyProperty TabStripPlacementProperty
TabUnpinnedEvent
RoutedEvent
Registers the TabUnpinned routed event.
public static readonly RoutedEvent TabUnpinnedEvent
TopTemplateProperty
DependencyProperty
Identifies the TopTemplate property.
public static readonly DependencyProperty TopTemplateProperty
Properties
Identifies the AdditionalContent property.
public object AdditionalContent { get; set; }
Gets or sets the alignment of the tab items in the row - Left, Right, Center, Justify. This is a dependency property.
[SRDescription("TabControlAlignDescription")]
[SRCategory("AppearanceCategory")]
public TabStripAlign Align { get; set; }
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.
Gets or sets a value indicating whether dragging objects over a tab item will select this TabItem. This is a dependency property.
[SRCategory("Behavior")]
public bool AllowDragOverTab { get; set; }
The DragOverTab feature will work only if the RadDragAndDropManager is used.
The default value is false.
Gets or sets a value indicating whether the user will be able to rearrange the tabs with dragging. This is a dependency property.
[SRCategory("Behavior")]
public bool AllowDragReorder { get; set; }
The default value is false.
Gets or sets whether all displayed tabs have equal height. This is a dependency property.
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlAllTabsEqualHeightDescription")]
public bool AllTabsEqualHeight { get; set; }
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
ControlTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Bottom. This is a dependency property.
[SRCategory("Appearance")]
[SRDescription("TabControlBottomTemplateDescription")]
public ControlTemplate BottomTemplate { get; set; }
For more information, please see TopTemplate property.
Gets or sets a value indicating whether user can close tabs by clicking the mouse middle button over a particular RadTabItem.
public bool CloseTabsOnMouseMiddleButtonDown { get; set; }
DropDownButtonStyle
Style
Gets or sets the style for the toggle button in the ControlTemplate of the tab control. This is a dependency property.
[SRCategory("AppearanceCategory")]
public Style DropDownButtonStyle { get; set; }
Gets or sets the name of property that will be used to display tab items in the . This is a dependency property.
public string DropDownDisplayMemberPath { get; set; }
Gets or sets when the button should be displayed: always, never, when needed. This is a dependency property.
public TabControlDropDownDisplayMode DropDownDisplayMode { get; set; }
DropDownStyle
Style
Gets or sets the style for the of the tab control. This is a dependency property.
[SRCategory("AppearanceCategory")]
public Style DropDownStyle { get; set; }
Inverts the scrolling direction when using the mouse wheel over the tab strip panel.
public bool InvertMouseWheelScrollDirection { get; set; }
Gets or sets a value indicating whether the of the tab control is open. This is a dependency property.
[SRCategory("AppearanceCategory")]
public bool IsDropDownOpen { get; set; }
ItemDropDownContentTemplate
DataTemplate
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.
[SRCategory("AppearanceCategory")]
public DataTemplate ItemDropDownContentTemplate { get; set; }
ItemDropDownContentTemplateSelector
DataTemplateSelector
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.
[SRCategory("AppearanceCategory")]
public DataTemplateSelector ItemDropDownContentTemplateSelector { get; set; }
LeftTemplate
ControlTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Left. This is a dependency property.
[SRCategory("Appearance")]
[SRDescription("TabControlLeftTemplateDescription")]
public ControlTemplate LeftTemplate { get; set; }
For more information, please see TopTemplate property.
Gets or sets what happens when the width of the tab items exceeds the available width. They will either scroll or wrap.
public TabOverflowMode OverflowMode { get; set; }
Gets the collection of currently pinned RadTabItems.
public ReadOnlyObservableCollection<RadTabItem> PinnedItems { get; }
RightTemplate
ControlTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Right. This is a dependency property.
[SRCategory("Appearance")]
[SRDescription("TabControlRightTemplateDescription")]
public ControlTemplate RightTemplate { get; set; }
For more information, please see TopTemplate property.
Gets or sets the type of scrolling that will occur when the user presses the scroll buttons. This is a dependency property.
public TabControlScrollMode ScrollMode { get; set; }
TabOrientation
Orientation
Gets or sets the orientation of the TabItems in the TabControl. This is a dependency property.
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlTabOrientationDescription")]
public Orientation TabOrientation { get; set; }
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.
Gets or sets the position of the tab strip with regard to the content. This is a dependency property.
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlTabStripPlacementDescription")]
public Dock TabStripPlacement { get; set; }
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
ControlTemplate
Gets or sets the template of the tab control when the TabStripPlacement is set to Top. This is a dependency property.
[SRCategory("Appearance")]
[SRDescription("TabControlTopTemplateDescription")]
public ControlTemplate TopTemplate { get; set; }
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
Updates the visual states of the control.
protected override void ChangeVisualState(bool useTransitions)
Identifies whether the transitions should be used.
Overrides:
When overridden in a derived class, undoes the effects of the method.
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
The container element.
itemobjectThe item.
FindTemplateFromPosition(Dock)
ControlTemplate
Returns a template for the given position of the tab strip.
protected virtual ControlTemplate FindTemplateFromPosition(Dock position)
The position for which a template is requested.
Returns:ControlTemplate
An instance of the template for the given position.
Returns a new instance of the control that implements the IRadTabItem interface.
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
public override void OnApplyTemplate()
OnCreateAutomationPeer()
AutomationPeer
Creates a peer associated with this object.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
An instance of the .
Called when a menu item has been clicked.
protected virtual void OnDropDownMenuItemClick(object sender, RoutedEventArgs e)
The sender of the event.
eRoutedEventArgsThe arguments of the event.
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Called when the IsDropDownOpen property changes.
Invoked when the property changes.
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Information about the change.
Invoked when the property changes.
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
Old value of the property.
newItemsPanelItemsPanelTemplateNew value of the property.
Invoked when the left scroll button has been clicked.
protected virtual void OnLeftScrollButtonClick(object sender, RoutedEventArgs e)
Raises the event.
protected virtual bool OnPreviewTabClosed(PreviewTabChangedEventArgs args)
The PreviewTabChangedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewTabPinned(PreviewTabChangedEventArgs args)
The PreviewTabChangedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewTabUnpinned(PreviewTabChangedEventArgs args)
The PreviewTabChangedEventArgs instance containing the event data.
Returns:Invoked when the right scroll button has been clicked.
protected virtual void OnRightScrollButtonClick(object sender, RoutedEventArgs e)
Invoked when scroll buttons visibility changes.
protected virtual void OnScrollButtonsVisibilityChanged()
Raises the SelectionChanged routed event and selection automation events.
protected override void OnSelectionChanged(RadSelectionChangedEventArgs e)
Overrides:
Raises the event.
protected virtual void OnTabClosed(TabChangedEventArgs args)
The TabChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnTabPinned(TabChangedEventArgs args)
The TabChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnTabUnpinned(TabChangedEventArgs args)
The TabChangedEventArgs instance containing the event data.
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Element used to display the specified item.
itemobjectSpecified item.
Scrolls the container of given item into view.
Updates the selected content properties SelectedContent, SelectedContentTemplate and SelectedContentTemplateSelector. Selected content properties are used when representing the content of selected tab item.
protected override void UpdateSelectedContentProperties()
Overrides:
Updates the tab strip.
protected void UpdateTabStrip()
Events
Occurs when a item is reordered while dragging. This is a RoutedEvent.
public virtual event ItemReorderedEventHandler ItemReordered
Occurs when a RadTabItem is about to be closed.
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabClosed
Occurs when a RadTabItem is about to be pinned.
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabPinned
Occurs when a RadTabItem is about to be unpinned.
public event EventHandler<PreviewTabChangedEventArgs> PreviewTabUnpinned
Occurs when a RadTabItem is closed.
public event EventHandler<TabChangedEventArgs> TabClosed
Occurs when a RadTabItem is pinned.
public event EventHandler<TabChangedEventArgs> TabPinned
Occurs when a RadTabItem is unpinned.
public event EventHandler<TabChangedEventArgs> TabUnpinned