Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

SortCompare Event, SftTree Object

Items are being sorted.

Syntax

VB.NETPrivate Sub object_SortCompare(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SortCompare
VBPrivate Sub object_SortCompare(ByVal StringVal1 As String, ByVal StringVal2 As String, ByVal ItemData1 As Long, ByVal ItemData2 As Long, RetVal As Integer)
C#.NETvoid object_SortCompare(object sender, EventArgumentType e);
VC++void OnSortCompareobject(_bstr_t StringVal1, _bstr_t StringVal2, long ItemData1, long ItemData2, short* RetVal);
CHRESULT OnSortCompareobject(BSTR StringVal1, BSTR StringVal2, long ItemData1, long ItemData2, short* RetVal);

object

A SftTree object.

StringVal1

The cell text of the item to be compared to the cell text StringVal2 of the second item.

StringVal2

The cell text of the item to be compared to the cell text StringVal1 of the first item.

ItemData1

The value of the item to be compared to the value ItemData2 of the second item. Depending on the SortType argument of the Items.SortDependents method, the ItemData1 parameter contains the following value:

SortTypeDescription
sortSftTreeEventItemData1 contains the Item.Data property value of the item being sorted.
sortSftTreeEventCellItemData1 contains the Cell.Data property value of the item being sorted.
sortSftTreeEventWithIndexItemData1 contains the index of the item being sorted. An application can retrieve property values from the item if necessary for comparison purposes.

ItemData2

The value of the item to be compared to the value ItemData1 of the first item. Depending on the SortType argument of the Items.SortDependents method, the ItemData2 parameter contains the following value:

SortTypeDescription
sortSftTreeEventItemData2 contains the Item.Data property value of the item being sorted.
sortSftTreeEventCellItemData2 contains the Cell.Data property value of the item being sorted.
sortSftTreeEventWithIndexItemData2 contains the index of the item being sorted. An application can retrieve property values from the item if necessary for comparison purposes.

RetVal

Returns the collating sequence. Return a value greater than zero to indicate that StringVal1 is greater than StringVal2 (or ItemData1 > ItemData2), equal to 0 to indicate that the values are equal, a value less than zero to indicate StringVal1 is less than StringVal2 (or ItemData1 < ItemData2).

Comments

The SortCompare event occurs when items are being sorted.

The SortCompare event is generated to compare two items. The return value set in RetVal determines the collating sequence of the items being compared. The SortCompare event is only generated when the Items.SortDependents method is used with a SortType of sortSftTreeEvent, sortSftTreeEventCell and sortSftTreeEventWithIndex. The immediate dependents are sorted in a fashion determined by the SortCompare event.

See Also SftTree Object | Object Hierarchy


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