Change appearance of lines as dotted lines in RadTreeView WPF

1 Answer 20 Views
TreeView
Aditi
Top achievements
Rank 1
Aditi asked on 26 May 2021, 02:11 PM

Hello,

Is there any way to change appearance of connecting lines to dotted lines of WPF RadTreeView? I am looking for something similar to WinForms RadTreeView LineStyle property. 

I have added attachment for reference.

Thank You.

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 31 May 2021, 12:12 PM

Hello Aditi,

To achieve your requirement you can extract the ControlTemplate of RadTreeViewItem and set the StrokeDashArray property of the Rectangle elements representing the lines. The Rectangles are named "IndentFirstVerticalLine", "HorizontalLine" and "VerticalLine". For example:

<Rectangle x:Name="HorizontalLine" StrokeDashArray="2 2" HorizontalAlignment="Right" Height="1" Stroke="#FFCCCCCC" VerticalAlignment="Center"/>

I hope that helps.

Also, there is a feature request to introduce a public API that will allow easier customization of the lines.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TreeView
Asked by
Aditi
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or