Articles in this section
Category / Section

How to hide expander in Xamarin.Forms TreeView?

2 mins read

You can hide expander of Xamarin.Forms SfTreeView by setting the ExpanderWidth property to zero in Xamarin.Forms.


Set the ExpandActionTarget to Node to expand or collapse the TreeViewNode.

<ContentPage xmlns=""
        <local:FileManagerViewModel x:Name="viewModel"/>
        <syncfusion:SfTreeView x:Name="treeView" ExpanderWidth="0" ExpandActionTarget="Node" ChildPropertyName="SubFiles" ItemTemplateContextType="Node" ItemsSource="{Binding ImageNodeInfo}">
                    <Grid x:Name="grid" RowSpacing="0" >
                            <ColumnDefinition Width="40" />
                            <ColumnDefinition Width="*" />
                        <Image Source="{Binding Content.ImageIcon}" VerticalOptions="Center" HorizontalOptions="Center" HeightRequest="35" WidthRequest="35"/>
                        <Grid Grid.Column="1" RowSpacing="1" Padding="1,0,0,0" VerticalOptions="Center">
                            <Label LineBreakMode="NoWrap" Text="{Binding Content.ItemName}" VerticalTextAlignment="Center"/>


Demo image to hide Expander in Xamarin.Forms TreeView.

View sample in GitHub


I hope you enjoyed learning about how to hide expander in Xamarin.Forms TreeView.

You can refer to our  Xamarin.Forms TreeView feature tour page to know about its other groundbreaking feature representations. You can also explore our  Xamarin.Forms TreeView documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied