Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;

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.

share|improve this question

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.

share|improve this answer
+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. – Kirk Kuykendall May 30 '11 at 16:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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