Contents
- Programmatically select the tab item
- Get the selected tab item using IsSelected
Having trouble getting help?
Contact Support
Contact Support
How to select a tab item programmatically?
Programmatically select the tab item
Using the SelectedIndex property of SfTabView, we can programmatically select the tab item as like in the below code snippet.
<tabView:SfTabView x:Name="tabView" SelectedIndex="2"/>
tabView.SelectedIndex = 2;
Get the selected tab item using IsSelected
Indicates whether the tab item is active or not. This property can be used to get selected item of tab view as like below code snippet.
<tabView:SfTabView x:Name="tabView" SelectionChanged="Index_Changed"/>
tabView.SelectionChanged += Index_Changed;
private void Index_Changed(object sender, TabSelectionChangedEventArgs e)
{
bool itemSelection = tab1.IsSelected;
if (itemSelection)
{
tab1.FontSize = 26;
}
}