I have a tool in ArcObjects that I'm working on where the OnClick()
method finds the current row in the active attribute table (not the selection, but the row that has the carat to the left of the left most column), changes the current row to the next one in the attribute table, selects that feature, and then pans to it (basically the same as right clicking on a row, and selecting "Pan To" from the context menu).
If I use a search cursor or a selection set (either from the IFeatureLayer
or the IDisplayTable
interfaces) to iterate through the list, it only returns the rows in numerical order according to the ObjectID
field. In most cases this suits our purposes, and I currently have this working.
However, in instances where the table is sorted by another field beforehand (say, a name field), is there a way to have a cursor or selection set that respects a sort done on the table before my tool is run?
I looked at ITableSort
, but it seems to apply to performing a sort instead of what I want to do. I'm currently running ArcGIS 10.2.1.