TreeView with lines between parent and child nodes

1 Answer 785 Views
TreeView
F.Hayyam
Top achievements
Rank 1
F.Hayyam asked on 09 Sep 2021, 12:09 PM

Hi,

Is there a way to show the lines between parent and child nodes at TreeView ?

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 10 Sep 2021, 03:09 PM

Hi Fazil,

Thanks for the provided information.

Showing lines between the parent and child nodes in the Kendo TreeView is possible by utilizing the Node Template Directive. The template helps to customize the content of the nodes in any way the developer sees fit. 

I've prepared a short StackBlitz demo that demonstrates the desired behavior.

https://stackblitz.com/edit/angular-2hkz8t?file=app/app.component.ts

The [style.paddingTop] is used for pushing the border and [style.borderTop] for creating the border above the first child node. The TreeView knows where to put a border-top as in the data there is a boolean key (first), which when set to true will target the child item node and place a border.

I hope this sheds some light on this case.

Regards,
Stoyan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Raju
Top achievements
Rank 1
commented on 08 Apr 2024, 02:46 AM

Hi Stoyan, What about treelist? Can we do the same for it as well?
Stoyan
Telerik team
commented on 09 Apr 2024, 07:23 AM

Hi Raju,

To do the same thing with the TreeList The developer can use the rowClass which can be used to change the CSS styles of each individual row based on some condition.

More information can be found here:

https://www.telerik.com/kendo-angular-ui/components/treelist/styling/rows/

I hope this information helps.

Regards,
Stoyan
Progress Telerik

Tags
TreeView
Asked by
F.Hayyam
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or