HeaderPane
Main
Hide

SftTree/NET 3.0 - Tree Control for Windows Forms

Share Link
Print

Sort Method, ItemCollectionClass Class

Sorts the items in the item collection.

Class: ItemCollectionClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

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 )

Parameters

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.

Comments

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.

See Also ItemCollectionClass Class | Classes | SftTree/NET 3.0