Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.