Ok,
I don' know well the B4XTable, but in a project i use tableview who's probably nearest to use.
And indeed i never found a solution to know what's the column who's sorted or not.
My solution maybe not the fastest, depends the size of data, but here i use it on 3 years of rates exchange need less than 1min.
I refresh the tableview with data from a list sorted, it's easy to sort data form a list ascending or not
An example more easy to understand where i use for the min and maxe rate exchange on this application in B4J:
Dim SQLRequest As String = "SELECT Date, Rate, DateLong FROM Currencies WHERE Currency='PHP' AND DateLong >=" & DatePicker1.DateTicks & " AND DateLong <=" & DatePicker2.DateTicks 'Used max 3 years, a bit more long :)
lst = DBUtils.ExecuteMemoryTable(mySQL, SQLRequest, Null, 0)
If (lst.Size > 0) Then
Dim lstMin, lstMax As List
lstMin.Initialize
lstMax.Initialize
For i = 0 To lst.Size - 1
Dim result() As String = lst.Get(i)
lstMin.Add(SingleLine1.NumberFormat3(result(1),2))
lstMax.Add(SingleLine1.NumberFormat3(result(1),2))
Next
lstMin.Sort(True) 'Sort ascending
lstMax.Sort(False) 'Sort unascending
Log("Minimum rate: " & lstMin.Get(0)) 'So the min is index 0
Log("Maximum rate: " & lstMax.Get(0)) 'So the max is index 0 also
'That's all
[EDIT]
When i see your Table i think your list is based on a Map where the records are stored with a type.
Maps are more easy to sort, you can even choose the key to sort on any column that you want
No example under the hand but it's easy to find on the Forum
Hope that'll help you.
Good coding,
Laurent