Display a Linear list in tree view
I have this class,
The Bones collection is linear with all of my bone objects are in the collection directly
While the children collection tells what Nodes are children to the bone
How to bind Bones with the item source of the TreeView Control to display the collection in hierarchical view?
this is my attempt in XAML
I get correct hierarchy But I get a lot of duplication
For each bone it will appear as a child node for its parent and a root node as well, How to prevent that ?
Hi Ahmed moussa,
We have checked the provided code snippet from our end. In SfTreeView.ItemTemplate,
you have loaded data as HierarchicalDataTemplate.
We also regret to inform you that currently, Our SfTreeView does not contain
support for achieving your requirement of “loaded data as
HierarchicalDataTemplate in SfTreeView”. You can populate data by creating a
hierarchical data model and binding it to SfTreeview. For more information
related to Data Population, please refer to the below user guide
documentation,
UG Link: Data
Population in WPF TreeView control | Syncfusion
You can download the SfTreeView Samples from below mentioned link,
GitHub Link: wpf-demos/treeview
at master · syncfusion/wpf-demos (github.com)
Based on the provided information, it seems that there is a lot of duplication
in your application. If possible, could you please provide a simple sample that
mirrors your scenario? This will help in replicating the reported problem
accurately. It will be more helpful for us to check the possibilities to
resolve the reported problem.
Regards,
Vijayarasan S
- 1 Reply
- 2 Participants
-
AM Ahmed moussa
- Dec 17, 2023 08:09 AM UTC
- Dec 18, 2023 07:15 PM UTC