3

I'm using ITableWindow2.FindViaStandaloneTable--that works. I can get the ITableWindow for the stand alone table and the table from that.

Then I try to sort using an ITableSort. No exceptions, but the table doesn't sort. Is ITableSort the right approach or is there a different approach to sorting within a Table Window?

ITableSort sort= new TableSortClass();
sort.Fields = "MDATE";
sort.Ascending["MDATE"] = true;
sort.Table = standAloneTable.Table;
sort.Sort(null);

The goal is to programmatically sort a field. The way an end-user would manually right click a column on an attribute table and sort ascending or descending.

1 Answer 1

4

No, ITableSort will not help you in this case. It returns a cursor which you can use to iterate through records sorted in the desired order.

To answer your question, I am sorry to say that sorting records in a table window does not seem to be exposed anywhere in the ArcObjects API.

1
  • +1 I wonder if this could be hacked by using spy++ to see what winapi messages are sent when interactively sorting a table, then writing a command to send those same messages. Commented May 30, 2011 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.