)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to sort the nodes in WinForms MultiColumnTreeView?

Platform: WinForms |
Control: MultiColumnTreeView |
Published Date: April 27, 2015 |
Last Revised Date: January 7, 2020

Sorting

In MultiColumnTreeView, 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#: http://www.syncfusion.com/downloads/support/directtrac/139533/MultiColumnTreeview_Sort457457753.zip

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

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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon