简体   繁体   中英

I use syncfusion treeview and need to customize datatemplate in special way

What i want it look like

How to customize the datatemplate so that child nodes have that triangle at top of itself(some kind of a curved shape of a Frame? I determine the node(root node or not) by binding to Level property inside datatemple of syncfusion treeview. What i thought was good for me:

  1. create two datatemplates one for child node, another for root node and dynamically choose deciding on Level property of datatemplate.
  2. create grid with two rows (top row will contain image of triangle), (bottom row will contain content of node)

And also selecting child node(has triangle at top) the triangle must paint itself in color of node`s selected background color.

Based on the provided information, we have prepared the sample in which you can find two different templates for Root and Sub-Level nodes as you mentioned. You can also customize the templates based on your requirements in TreeView. Please find the sample from the following link,

Sample : https://www.syncfusion.com/downloads/support/directtrac/256047/ze/TemplateSelector-1363379301

You can refer the Treeview documentation with TemplateSelector customization from the following link,

https://help.syncfusion.com/xamarin/treeview/appearance#itemtemplate-selector

We hope this helps. Please let us know if you need any further assistance.

Regards,

Gnana

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM