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; fields.AddField(field); 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 ?