Provides access to members that compare field values for a table sort operation.
Members
Name | Description | |
---|---|---|
Compare | Compare fields. Return result as 0 = match, -1 = field1 < field2, 1 = field1 > field2, 2 = force caller to calculate. |
ITableSortCallBack.Compare Method
Compare fields. Return result as 0 = match, -1 = field1 < field2, 1 = field1 > field2, 2 = force caller to calculate.
Public Function Compare ( _
ByVal value1 As Object, _
ByVal value2 As Object, _
ByVal FieldIndex As Integer, _
ByVal fieldSortIndex As Integer _
) As Integer
public int Compare (
object value1,
object value2,
int FieldIndex,
int fieldSortIndex
);
Classes that implement ITableSortCallBack
Classes | Description |
---|
Remarks
The ITableSortCallBackmechanism allows you to perform custom sorting operations. The comparemethod in ITableSortCallbackis called each time two values need to be compared. From these two values, you need to evaluate which is the greater or lesser, or if the two values are equal. The default implementation is to compare the entire values. With the ITableSortCallBackinterface you can compare parts of the two values. For example, if you want to sort on an address field which includes street numbers and names, you can parse the two values to omit the street number and then compare the remaining values, the street names.When the comparemethod is called, the table field index and the sort field index are returned. The sort index refers to the current field number that you are comparing in the field list you specified to sort on.