BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Hi,
I try to bing a list of custom class in a TreeViewAdv.
My class :
public class Category
{
public Int64 pkCategory { get; set; }
public String Name { get; set; }
public Int64 fkCategoryParent { get; set; }
}
my goal is to use Binding to Self-Referencing Data.
With many tests impossible to set the relation child vs parent.
Always all my nodes are ROOT.
Can you help me, i attached my sample test to this ticket
Regards
Cyrille
Attachment: TreeViewAdv_CF_Test_b5398f9.zip
Hi Cyrille,
Currently, we are checking the reported issue on
our end. We will check and update you on further details on July 21, 2022.
We appreciate your patience until then.
Regards,
Dhanasekar M.
Hi Cyrille,
We have checked your requirement. By default, our TreeViewAdv does not support binding the SelfRelationRootValue to an ObservableCollection or list, its Binds only to the data Table. We have modified your sample with the DataTable.
If you need to bind the collection for TreeViewAdv you can achieve this by using the Object Relational Data which is used to bind class objects which have collections associated with other dependent class objects establishing proper relation. For more information related to binding to object-relational data, please refer to the below user guide documentation link,
UG Link: https://help.syncfusion.com/windowsforms/treeview/data-binding#binding-to-object-relational-data
Please find the modified sample and our data binding demo in the attachment and let us know if you have any concerns about this.
Regards,
Dhanasekar M.
HI,
Thank you for the answer.
And sorry for the delay.
Regards
Cyrille
Hi Cyrille,
If you are satisfied with our response, please mark it as an answer. Otherwise,
please let us know if you have any further queries on this. We are happy to
help you.
Regards,
Dhanasekar M.
Hi,
It is done ;)
Regards
Cyrille
To bind a list of custom classes to a TreeViewAdv control, you would need to follow these general steps:
Create a list of instances of your custom class.
Set the list as the data source for the TreeViewAdv control.
Define the hierarchical structure of the TreeViewAdv control by setting the properties of the control's Nodes collection. You can use properties such as Text, Tag, and Nodes to set the display text, associated data, and child nodes for each tree node.
Configure the TreeViewAdv control's appearance and behavior as needed, using properties such as Font, ForeColor, and ShowLines.
Hope You Find This Useful,
Peter