I am new to this site as a registered user and new to GIS in general, and it has proven quite useful to me.

I have a very annoying problem with the attribute table being filled by an ArcMap extension, every column of type String cannot be ordered/sorted at all. The table is supposed to display DateTimes, and it was chosen to convert them to Strings. I tried to change one of these fields to "esriFieldTypeDate" and it worked, meaning the dates are correctly sorted.

Unfortunately, none of the columns using Strings (esriFieldTypeString) can be sorted. If the initial order by IDs is changed by a new ordre on another column, and then I try to sort a String column, it gets back to this initial order. by IDs.

I have no control on the sorting operation, just data being initialized when creating a solver, and then given a value, as follows.

Here is the initialization on creating a new solver:

        fields = new Fields() as IFieldsEdit;

        // Arrival time
        field = new Field() as IFieldEdit;
        field.Name_2 = UnlocalisableResources.arrivalTimeField;
        field.AliasName_2 = MobiAnalyst.arrivalTimeField;
        field.Type_2 = esriFieldType.esriFieldTypeString;

        classDefinition.Fields = fields;

And here is where the field value is set:

        dateTime = new DateTime();
        dateTime += TimeSpan.FromMinutes(arrivalTime);
        linesFeatureBuffer.set_Value((int)arrivalTimeFieldIndex, dateTime.ToLongTimeString());

Since I found absolutely nothing about this particular problem on various forums, I was asking myself if it may be a simple formatting or encoding problem on the Strings, or anything else someone would know about ?

  • Welcome to GIS-SE! As a new user my advice would be to always try and keep questions clear and concise. In this one you've told a story but not provided a key detail like the procedure or code you used to do the sort. Would you be able to revise your question to less story and more detail, please? – PolyGeo May 27 '13 at 20:19
  • Ok, thanks for the feedback, I am going to edit it. But the problem actually is that I don't have any control on the sort, the attribute table handles it by itself. – Arnaud31 May 28 '13 at 7:06
  • I've just added an arcobjects tag because my initial read had me thinking you were using the ArcGIS for Desktop GUI and/or ArcPy to do this. – PolyGeo May 28 '13 at 7:28
  • Well I guess being new to this doesn't really help to know precisely what to say, it is nice to at least have advice on how to ask my questions in a better way. – Arnaud31 May 28 '13 at 7:33
  • Thanks for taking the advice in the spirit it was intended. Unfortunately, yours is not a question that I can help with personally but I think it is reading much more clearly now. – PolyGeo May 28 '13 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.