Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

SortIndicator Property, SftTreeHeader Object

Defines the column header's sort indicator appearance.

Syntax

Get

VB.NETStyle = object.SortIndicator As SftTreeSortIndicatorConstants
VBStyle = object.SortIndicator As SftTreeSortIndicatorConstants
C#.NETSftTreeSortIndicatorConstants Style = object.SortIndicator;
VC++enum SftTreeSortIndicatorConstants Style = object->SortIndicator;
enum SftTreeSortIndicatorConstants Style = object->GetSortIndicator();
CHRESULT object->get_SortIndicator(enum SftTreeSortIndicatorConstants* Style);

Put

VB.NETobject.SortIndicator = Style As SftTreeSortIndicatorConstants
VBobject.SortIndicator = Style As SftTreeSortIndicatorConstants
C#.NETSftTreeSortIndicatorConstants object.SortIndicator = Style;
VC++enum SftTreeSortIndicatorConstants object->SortIndicator = Style;
void object->PutSortIndicator(enum SftTreeSortIndicatorConstants Style);
CHRESULT object->put_SortIndicator(enum SftTreeSortIndicatorConstants Style);

object

A SftTreeHeader object.

Style

Defines the column header's sort indicator appearance.

NameValueDescription
sortIndicatorSftTreeNone0None. No sort indicator is shown for this column.
sortIndicatorSftTreeAscending1Ascending. A sort indicator is shown for this column indicating an ascending sort.
sortIndicatorSftTreeDescending2Descending. A sort indicator is shown for this column indicating a descending sort.

Comments

The SortIndicator property defines the column header's sort indicator appearance.

Examples

VB.NET

                ItemIndex = AxSftTree1.Items.Current
                Dim ID As Integer
                ID = 0
                If ItemIndex >= 0 Then
                    ID = AxSftTree1.get_Item(ItemIndex).ID
                End If
                If ID = m_InboxFolder Or ID = m_OutboxFolder Or ID = m_SavedFolder Or ID = m_DeletedFolder Then
                    ' we're on a folder, so sort on folder level
                    If AxSftTree1.get_Header(SortedColumn).SortIndicator = SftTreeSortIndicatorConstants.sortIndicatorSftTreeAscending Then
                        If (SortedColumn = 3) Then
                            ' last column is sorted by Cell.Data (numeric values)
                            AxSftTree1.Items.SortDependents(-1, SortedColumn, SftTreeSortTypeConstants.sortSftTreeAscCellItemData)
                        Else
                            AxSftTree1.Items.SortDependents(-1, SortedColumn, SftTreeSortTypeConstants.sortSftTreeAscending)
                        End If
                    Else

VB6

            Dim SortedColumn As Integer
            SortedColumn = .Headers.SortedColumn
            If SortedColumn >= 0 Then
                ' we have to sort based on current column headers
                ' we saved a value in Item.Data telling us if it's a folder
                Select Case .Item(.Items.Current).ID
                Case InboxFolder, OutboxFolder, SavedFolder, DeletedFolder
                    ' we're on a folder, so sort on folder level
                    If .Header(SortedColumn).SortIndicator = sortIndicatorSftTreeAscending Then
                        If SortedColumn = 3 Then
                            ' last column is sorted by Cell.Data (numeric values)
                            .Items.SortDependents -1, SortedColumn, sortSftTreeAscCellItemData
                        Else
                            .Items.SortDependents -1, SortedColumn, sortSftTreeAscending
                        End If
                    Else

C#

                if (sortedColumn >= 0) {
                    // we have to sort based on current column headers
                    int ItemIndex = axSftTree1.Items.Current;
                    int ID = 0;
                    if (ItemIndex >= 0)
                        ID = axSftTree1.get_Item(ItemIndex).ID;
                    if (ID == m_InboxFolder || ID == m_OutboxFolder || ID == m_SavedFolder || ID == m_DeletedFolder) {
                        // we're on a folder, so sort on folder level
                        if (axSftTree1.get_Header(sortedColumn).SortIndicator == SftTreeSortIndicatorConstants.sortIndicatorSftTreeAscending) {
                            if (sortedColumn == 3)
                                // last column is sorted by Cell.Data (numeric values)
                                axSftTree1.Items.SortDependents(-1, sortedColumn, SftTreeSortTypeConstants.sortSftTreeAscCellItemData);
                            else
                                axSftTree1.Items.SortDependents(-1, sortedColumn, SftTreeSortTypeConstants.sortSftTreeAscending);
                        } else {
                            if (sortedColumn == 3)

C++

    } else if (AreaType == constSftTreeColumn) {
        int sortedColumn = m_vTree->Headers->SortedColumn;
        if (sortedColumn >= 0) {
            // we have to sort based on current column headers
            // we saved a value in Item.Data telling us if it's a folder
            long current = m_vTree->Items->Current;
            long currentID = m_vTree->Item[current]->ID;
            if (currentID == m_InboxFolder || currentID == m_OutboxFolder || currentID == m_SavedFolder || currentID == m_DeletedFolder) {
                if (m_vTree->Header[sortedColumn]->SortIndicator == sortIndicatorSftTreeAscending) {
                    if (sortedColumn == 3)
                        // last column is sorted by Cell.Data (numeric values)
                        m_vTree->Items->SortDependents(-1, sortedColumn, sortSftTreeAscCellItemData);
                    else
                        m_vTree->Items->SortDependents(-1, sortedColumn, sortSftTreeAscending);
                } else {
                    if (sortedColumn == 3)

See Also SftTreeHeader Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.