Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

SortedColumn Property, SftTreeHeaders Object

Returns the column number of the first column with a sort indicator.

Syntax

Get

VB.NETColIndex = object.SortedColumn As Short
VBColIndex = object.SortedColumn As Integer
C#.NETshort ColIndex = object.SortedColumn;
VC++short ColIndex = object->SortedColumn;
short ColIndex = object->GetSortedColumn();
CHRESULT object->get_SortedColumn(short* ColIndex);

object

A SftTreeHeaders object.

ColIndex

Returns the column number of the first column with a sort indicator. -1 is returned if none of the columns has a sort indicator.

Comments

The SortedColumn property returns the column number of the first column with a sort indicator.

The sort direction of the sort indicator can be determined using the Header.SortIndicator property.

Examples

VB.NET

            End If
        ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeText Then
            ' edit description
            If e.colIndex = 1 Then
                AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0)
            End If
        ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeColumn Then
            Dim SortedColumn As Integer
            SortedColumn = AxSftTree1.Headers.SortedColumn
            If SortedColumn >= 0 Then
                ' we have to sort based on current column headers
                Dim ItemIndex As Integer
                ItemIndex = AxSftTree1.Items.Current
                Dim ID As Integer
                ID = 0
                If ItemIndex >= 0 Then

VB6

            End If
        ElseIf AreaType = constSftTreeText Then
            ' edit description
            If ColIndex = 1 Then
                .Cell(ItemIndex, ColIndex).Edit 0, 0
            End If
        ElseIf AreaType = constSftTreeColumn Then
            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

C#

                    axSftTree1.get_Item(e.itemIndex).Collapse(true);
                else
                    axSftTree1.get_Item(e.itemIndex).Expand(true, false);
            } else if (area == SftTreeAreaTypeConstants.constSftTreeText) {
                // edit description
                if (e.colIndex == 1)
                    axSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0);
            } else if (area == SftTreeAreaTypeConstants.constSftTreeColumn) {
                short sortedColumn = axSftTree1.Headers.SortedColumn;
                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) {

C++

            m_vTree->Item[ItemIndex]->Collapse(VARIANT_TRUE);
        else
            m_vTree->Item[ItemIndex]->Expand(VARIANT_TRUE, VARIANT_FALSE);
    } else if (AreaType == constSftTreeText) {
        // edit description
        if (ColIndex == 1)
            m_vTree->Cell[ItemIndex][ColIndex]->Edit(0, _variant_t(0L));
    } 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) {

See Also SftTreeHeaders Object | Object Hierarchy


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