... postgre, etc. XBrowse derives the field name from the expression and stores the right information in oCol:cSortOrder. On header click, xbrowse uses this information to switch the sort order and it also knows depending on the datasource, how to change the sort order. Better we leave all this ...