SftTree/OCX 7.0

SftTree.SortCompare Event

Softel vdm, Inc.

Items are being sorted.

Syntax       

VB.NET

Private Sub object_SortCompare(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SortCompare

VB

Private Sub object_SortCompare(ByVal StringVal1 As String, ByVal StringVal2 As String, ByVal ItemData1 As Long, ByVal ItemData2 As Long, RetVal As Integer)

C#.NET

void object_SortCompare(object sender, EventArgumentType e);

VC++

void OnSortCompareobject(_bstr_t StringVal1, _bstr_t StringVal2, long ItemData1, long ItemData2, short* RetVal);

C

HRESULT OnSortCompareobject(BSTR StringVal1, BSTR StringVal2, long ItemData1, long ItemData2, short* RetVal);

Delphi

procedure objectSortCompare(Sender: TObject; StringVal1 : WideString; StringVal2 : WideString; ItemData1 : Integer; ItemData2 : Integer; var RetVal : Smallint);

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:

SortType

Description

sortSftTreeEvent 

ItemData1 contains the Item.Data property value of the item being sorted.

sortSftTreeEventCell 

ItemData1 contains the Cell.Data property value of the item being sorted.

sortSftTreeEventWithIndex

ItemData1 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:

SortType

Description

sortSftTreeEvent 

ItemData2 contains the Item.Data property value of the item being sorted.

sortSftTreeEventCell 

ItemData2 contains the Cell.Data property value of the item being sorted.

sortSftTreeEventWithIndex

ItemData2 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


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com