The orientation of the tab items can be switched using the
TabOrientation
property of RadTabControl. The supported orientations are
Horizontal
and
Vertical
. The tabs are oriented horizontally by default.
The size and spacing of the RadTabItem elements can be modified using the
Width
,
Height
,
Margin
and
Padding
properties inherited from the FrameworkElement base class.
Example 2: Setting sizing and spacing of tab items
The control also provides style selector support via the
ItemContainerStyleSelector
property of RadTabControl. Read how to implement a
StyleSelector
in the corresponding
MSDN article
.
The template of the RadTabItems can be customized using the
ItemTemplate
property of RadTabControl. The property is useful in case the ItemsSource of the control is used (data binding scenario).
The following example shows how to setup a basic model, populate RadTabControl with data and customize the template of the tabs.
Example 4: Defining tab model
public class TabInfo
{
public string Header { get; set; }
public string Content { get; set; }
}
Example 5: Populating the control with data
public MyUserControl()
{
InitializeComponent();
this.DataContext = new ObservableCollection<TabInfo>()
{
new TabInfo() { Header = "Home", Content="Home content" },
new TabInfo() { Header = "Insert", Content="Insert content" },
new TabInfo() { Header = "Settings", Content="Settings content" }
};
}
The ItemTemplate is inherited by the
HeaderTemplate
property of each RadTabItem. The HeaderTemplate property can be used as an alternative of the ItemTemplate.
The ItemTemplate and HeaderTemplate have corresponding DataTemplateSelector alternatives - the
ItemTemplateSelector
and
HeaderTemplateSelector
properties - that allow you to choose the DataTemplate based on a custom condition. Read how to implement a
DataTemplateSelector
in the corresponding
MSDN article
.
The template of the selected tab content can be customized using the
ContentTemplate
property of RadTabControl.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See
Trademarks
for appropriate markings.