We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to disable a SfTabItem in a SfTabView?

Good afternoon,

how to disable a SfTabItem in a SfTabView?

Thanks in advance

1 Reply

HM Hemalatha Marikumar Syncfusion Team October 22, 2019 02:39 AM

Hi Marco, 
  
Greetings from Syncfusion. 
  
We have analyzed your query. You can disable the navigation of “TabItem in a SfTabView” by using TabItemTapped event of TabView and disable the EnableSwiping as like below code snippet. 
  
XAML: 
<tabView:SfTabView TabItemTapped="SfTabView_TabItemTapped"   EnableSwiping="False" BackgroundColor="Aqua"> 
            <tabView:SfTabItem " Title="Call"> 
                <tabView:SfTabItem.Content > 
                    <Grid BackgroundColor="Red" x:Name="AllContactsGrid" /> 
                </tabView:SfTabItem.Content> 
            </tabView:SfTabItem> 
</tabView:SfTabView> 
  
C#: 
private void SfTabView_TabItemTapped(object sender, Syncfusion.XForms.TabView.TabItemTappedEventArgs e) 
{ 
            e.Cancel = true; 
} 
  
You can also hide the “TabItem in a SfTabView” by setting IsVisble property of TabItem as like below code snippet. 
  
<tabView:SfTabItem IsVisible="False" Title="Contacts"> 
                <tabView:SfTabItem.Content> 
                    <Grid BackgroundColor="Blue" x:Name="ContactsGrid" /> 
                </tabView:SfTabItem.Content> 
</tabView:SfTabItem> 
  
We have created sample based on your requirement, please download the sample from below location. 
  
  
Please let us know if you have any other queries. 
 
Regards, 
Hemalatha M. 


Loader.
Live Chat Icon For mobile
Up arrow icon