SfTreeNavigator: Hide Header

Hi,

Could you tell me if there is any easy way to hide the header item (i.e., the item holding the text "Enterprise Toolkit" in the following image).


Regards,
Arvin

1 Reply 1 reply marked as answer

EM Elakkiya Muthukumarasamy Syncfusion Team April 9, 2021 12:32 PM UTC

Hi Arvin, 
 
Greetings from Syncfusion. 
 
We have checked your reported query “Need to hide SfTreeNavigator Header” and we would like to let you know that you could not directly hide the header in SfTreeNavigator. But you can achieve this by overriding the SyncfusionSfTreeNavigatorStyle. In the style we can be able to collapse or hide the visibility of the header item. Please refer the below sample and code snippet. 
 
Code example: 
 
<Grid> 
<Grid.Resources> 
<Style x:Key="CustomSfTreeNavigatorStyle" TargetType="navigation:SfTreeNavigator" BasedOn="{StaticResource SyncfusionSfTreeNavigatorStyle}" > 
 
</Style> 
</Grid.Resources> 
<navigation:SfTreeNavigator x:Name="tree" SelectionChanged="Tree_SelectionChanged"  BorderThickness="0" Grid.Row="0"   Header="Enterprise Toolkit" Height="auto" HorizontalAlignment="Left" Width="200" NavigationMode="Default"  Style="{DynamicResource CustomSfTreeNavigatorStyle}"> 
 
<navigation:SfTreeNavigatorItem Header="WinRT (XAML)"  > 
<navigation:SfTreeNavigatorItem Header="Chart"/> 
<navigation:SfTreeNavigatorItem Header="Tools"/> 
</navigation:SfTreeNavigatorItem> 
</navigation:SfTreeNavigator> 
 
</Grid> 
 
 
Output: 
 
 
Please try it with the above solution and let us know if you need any further assistance on this. 
 
Regards, 
Elakkiya 


Marked as answer
Loader.
Up arrow icon