Articles in this section
Category / Section

How to sort the nodes in WinForms MultiColumnTreeView?

3 mins read

Sorting

In WinForms Multicolumn TreeView, you can sort selected node and its node collection by using the SortOrder property and Sort function in TreeNodeAdv. Refer to the following code examples.   

C#

//Sets the selected tree node Sorting order as ascending
this.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.Ascending;
//Sets the selected tree node Sorting order as descending
this.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.Descending;
//Sets the selected tree node Sorting order as None
this.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.None;
//Sorts the selected tree nodes with specified sort order
this.multiColumnTreeView1.SelectedNode.Sort();

VB

'Sets the selected tree node Sorting order as ascending
Me.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.Ascending
'Sets the selected tree node Sorting order as descending
Me.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.Descending
'Sets the selected tree node Sorting order as None
Me.multiColumnTreeView1.SelectedNode.SortOrder = SortOrder.None
'Sorts the selected tree nodes with specified sort order
Me.multiColumnTreeView1.SelectedNode.Sort

 

Note:

If TreenodeAdv column is sorted, corresponding subitem column will also updated.

Ascending order of the selected nodes in MultiColumnTreeView

Figure 1: Ascending order of the selected nodes in MultiColumnTreeView

 

Descending order of the selected nodes in MultiColumnTreeView

Figure 2: Descending order of the selected nodes in MultiColumnTreeView.

Samples:

C#: https://www.syncfusion.com/downloads/support/directtrac/139533/MultiColumnTreeview_Sort457457753.zip

VB: https://www.syncfusion.com/downloads/support/directtrac/135220/MultiColumnTreeview_Sort_VB-1427910506.zip

Reference link: https://help.syncfusion.com/windowsforms/multicolumn-treeview/sorting

Conclusion

I hope you enjoyed learning about how to sort the nodes in WinForms Multicolumn TreeView.

You can refer to our  WinForms Multicolumn TreeView’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms Multicolumn TreeView documentation to understand how to present and manipulate data. 

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms Multicolumn TreeView and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied