We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

[Solved] - Sort parent node question!

Hi,
Can I sort parent nodes (regardless of child node level2), which is sort nodes of root nodes (keep child nodes intact). 
Do I have to reassign all nodes?
Thanks you.

3 Replies

DV Duraimurugan Vedagiri Syncfusion Team May 25, 2020 10:23 AM UTC

Hi GridLock,

Query: How to sort root node alone(keep child nodes intact)?

You can achieve this requirement with help TreeViewAdv.Root property.

Code Snippet
//Sort the node based on order
TreeViewAdv.Root.SortOrder = SortOrder.Ascending; 
//Sort the node based on type
TreeViewAdv.Root.SortType = TreeNodeAdvSortType.Text; 
//Sort the node
TreeViewAdv.Root.Sort(); 

Please refer the below documentation and sample for your reference.

Documentation : https://help.syncfusion.com/windowsforms/treeview/sorting

Sample : https://www.syncfusion.com/downloads/support/forum/154542/ze/Sample-1931506687.zip  

Regards,
Durai


TG The GridLock May 25, 2020 08:34 PM UTC

Thanks Durai ,It worked .



DV Duraimurugan Vedagiri Syncfusion Team May 26, 2020 10:51 AM UTC

Hi GridLock,

Thanks for your update.

Please let us know if you need any further assistance.

Regards,
Durai

Loader.
Up arrow icon