Tree lines in WinUI TreeView

The TreeView allows to show the tree lines for treeview nodes by enabling the ShowLines property as true. The default value is false.

<Syncfusion:SfTreeView Name="treeView" ShowLines="True" />
treeView.ShowLines = true;

TreeLines for WinUI TreeView

Enable tree line for root nodes

The TreeView also supports to show the tree lines for root nodes by enabling the ShowRootLines property as true. The default value is false.

<Syncfusion:SfTreeView Name="treeView"    
                       ShowLines="True"
                       ShowRootLines="True" />
treeView.ShowLines = true;
treeView.ShowRootLines = true;

TreeLines for WinUI TreeView

Customizing the tree lines

Customizing the line color

The TreeView allows to change the color of tree lines by using the LineStroke property. The default value is SystemBaseMediumLowColor.

<Syncfusion:SfTreeView Name="treeView"    
                       ShowLines="True"
                       ShowRootLines="True"
                       LineStroke="DeepSkyBlue" />
treeView.ShowLines = true;
treeView.ShowRootLines = true;
treeView.LineStroke = new SolidColorBrush(Colors.DeepSkyBlue);

TreeLines for WinUI TreeView

Customizing the line thickness

The TreeView allows to change the thickness of tree lines by using the LineStrokeThickness property. The default value is 1.

<Syncfusion:SfTreeView Name="treeView"           
                       ShowLines="True"
                       ShowRootLines="True"
                       LineStrokeThickness="1.5" />
treeView.ShowLines = true;
treeView.ShowRootLines = true;
treeView.LineStrokeThickness = 1.5;