var tv = TableView.Active;
if (tv == null)
return;
// sort the active field descending
if (tv.CanSortDescending)
tv.SortDescending();
// sort the active field ascending
if (tv.CanSortAscending)
tv.SortAscending();
// peform a custom sort programmatically
if (tv.CanCustomSort)
{
// sort fields
var dict = new Dictionary<string, FieldSortInfo>();
dict.Add("STATE_NAME", FieldSortInfo.Asc);
dict.Add("CITY_NAME", FieldSortInfo.Desc);
await tv.SortAsync(dict);
}
// perform a custom sort via the UI
if (tv.CanCustomSort)
tv.CustomSort();