This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IT > ITableSortCallBack Interface (ArcObjects .NET 10.4 SDK) |
Provides access to members that compare field values for a table sort operation.
Description | ||
---|---|---|
Compare | Compare fields. Return result as 0=match, -1=field1 < field2, 1=field1 > field2, 2=force caller to calculate. |
The ITableSortCallBack mechanism allows you to perform custom sorting operations. The compare method in ITableSortCallback is 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 ITableSortCallBack interface 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 compare method 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.
ITableSort Interface | ITable Interface