New to Telerik UI for .NET MAUI? Start a free 30-day trial
TabViewItem
TabViewItem
is the control used to populate the TabView. It displays the header of the tab item and the corresponding content. TabViewItem
exposes the following properties:
HeaderText
(string
)—Defines a simple text for the TabView item.ImageSource
(ImageSource
)—Specifies the source of the image icon in the header item.IsSelected
(bool
)—Indicated whether the item is selected.IsEnabled
(bool
)—Defines whether the TabView Item is enabled/disabled. By defaultIsEnabled
isTrue
.IsVisible
(bool
)—Specifies whether the TabView Item is visible/hidden.Content
(Microsoft.Maui.Controls.View
)—Defines the content of the TabView Item. You can use any UI element that implements theView
class.ContentTemplate
(DataTemplate
)—Defines the content template that is displayed when the current tab is selected.
Displaying TabViewItem
To display a TabViewItem
, you can add it to the Items
collection of TabView
or use the TabView ItemsSource.
Example
The following example shows how to add TabView items directly to the Items collection:
XAML
<telerik:RadTabView x:Name="tabView">
<telerik:TabViewItem HeaderText="Home" />
<telerik:TabViewItem HeaderText="Folder" />
<telerik:TabViewItem HeaderText="View" />
</telerik:RadTabView>
Defining Content
You can define the content of a TabViewItem
via its Content
property or ContentTemplate
property.
Example with Content Property
xaml
<telerik:RadTabView x:Name="tabView" AutomationId="tabView">
<telerik:TabViewItem HeaderText="Home">
<Label Margin="10" Text="This is the content of the Home tab" />
</telerik:TabViewItem>
<telerik:TabViewItem HeaderText="Folder">
<Label Margin="10" Text="This is the content of the Folder tab" />
</telerik:TabViewItem>
<telerik:TabViewItem HeaderText="View">
<Label Margin="10" Text="This is the content of the View tab" />
</telerik:TabViewItem>
</telerik:RadTabView>
The TabView control displays only the content of the selected item.