How to disable a SfTabItem in a SfTabView?

Good afternoon,

how to disable a SfTabItem in a SfTabView?

Thanks in advance

3 Replies

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

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. 



JE Jens February 10, 2025 10:42 AM UTC

Hi there,


sorry to "warm up" this old thread.

I'd like to change the visibilty of one or more tabView:SfTabItem entries by code/ runtime. It looks like this is not possible?! Hopefully I am wrong: How can I achieve this?

I'd like to let only a group of logins to access enhanced administrational tabs of a tabview.


Kind regards,

Jens



KP Kamalesh Periyasamy Syncfusion Team February 17, 2025 02:18 PM UTC

Hi Jens,


We have reviewed your query regarding the dynamic visibility of SfTabItems. To address your requirement, we bound boolean properties to each tab item and enabled the visibility of specific tabs based on a button click (admin authentication). 


For your reference, we have modified the sample code and attached it below. Please review it and let us know if it meets your requirements. 


Regards, 

Kamalesh P 


Attachment: TabViewItemVisibility_f7f40a75.zip

Loader.
Up arrow icon