I've searched high and low but I cannot find out how you can determine which column of a tableview is the sorted column (and the sort order) that has been chosen by a User by clicking on it.
The reason I would like to know this is for the case where the User is allowed to click on any of the columns to sort the table (ascending or descending) according to their viewing preference. At some point they add a new record (separate panel) and this record needs to be added into the tableview, preferably in the appropriate sorted location (as opposed to the end of the table).
I could always refresh the table from the database after the record is inserted but that would:
The reason I would like to know this is for the case where the User is allowed to click on any of the columns to sort the table (ascending or descending) according to their viewing preference. At some point they add a new record (separate panel) and this record needs to be added into the tableview, preferably in the appropriate sorted location (as opposed to the end of the table).
I could always refresh the table from the database after the record is inserted but that would:
- Undo the sort;
- And seems expensive when I could simply add the row at the right spot (if I knew which column was the sorted column).