SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Sorts the items in the item collection.
Class: ItemCollectionClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET
public void Sort(); public void Sort( IComparer Comparer ); public void Sort( IComparer Comparer, bool Recursive );
Public Sub Sort() Public Sub Sort( ByVal Comparer As IComparer ) Public Sub Sort( ByVal Comparer As IComparer, ByVal Recursive As Boolean )
Comparer
Defines a method that compares two items or null/Nothing to use the SortAscending class implementation.
Recursive
Defines whether the dependents are also sorted, True to sort all direct and indirect dependents also, otherwise False. The default is False.
Sorts the items in the item collection.
Comparer implements a method that is used to compare two items. The sorting process calls this method repeatedly to sort the item collection. The method can sort items based on any of their attributes, even multiple keys.
Default implementations are available to sort cell text in a column ascending (SortAscending) or descending (SortDescending). Samples, including the implementation of SortAscending and SortDescending are shown below.
if (e.Area != ItemClickAreaEnum.Cell) return; bool fAscending = SetSorted(e.Cell.ColumnIndex); switch (e.Cell.ColumnIndex) { default: // column 0 and 1 are sorted based on the Text property if (fAscending) sftTree1.ItemCollection.Sort(new SortAscending(e.Cell.ColumnIndex)); else sftTree1.ItemCollection.Sort(new SortDescending(e.Cell.ColumnIndex)); break; case 2: case 3: // column 2 and 3 are sorted based on the TagObject property, interpreted as a long if (fAscending) sftTree1.ItemCollection.Sort(new SortTagObjectAsLongAscending(e.Cell.ColumnIndex)); else
Return End If Dim fAscending As Boolean = SetSorted(e.Cell.ColumnIndex) Select Case e.Cell.ColumnIndex Case 2, 3 ' column 2 and 3 are sorted based on the TagObject property, interpreted as a long If fAscending Then sftTree1.ItemCollection.Sort(New SortTagObjectAsLongAscending(e.Cell.ColumnIndex)) Else sftTree1.ItemCollection.Sort(New SortTagObjectAsLongDescending(e.Cell.ColumnIndex)) End If Case Else ' column 0 and 1 are sorted based on the Text property If fAscending Then sftTree1.ItemCollection.Sort(New SortAscending(e.Cell.ColumnIndex)) Else
See Also ItemCollectionClass Class | Classes | SftTree/NET 2.0