ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TableView Class / SortAsync Method
The field sort information. When null the sort of the table will revert to database order. If any of the field's sort information is set to FieldSortInfo.AscCase or FieldSortInfo.DescCase, the sort will be case sensitive.
Example

In This Topic
    SortAsync Method (TableView)
    In This Topic
    Sorts the attributes in the table view.
    Syntax

    Parameters

    sortFields
    The field sort information. When null the sort of the table will revert to database order. If any of the field's sort information is set to FieldSortInfo.AscCase or FieldSortInfo.DescCase, the sort will be case sensitive.

    Return Value

    Returns True the sort succeeded.
    Example
    Sort
    {
      // sort the active field descending
      if (tableView.CanSortDescending)
        tableView.SortDescending();
    
      // sort the active field ascending
      if (tableView.CanSortAscending)
        tableView.SortAscending();
    
      // perform a custom sort programmatically
      if (tableView.CanCustomSort)
      {
        // sort fields
        Dictionary<string, FieldSortInfo> dict = new()
        {
          { "STATE_NAME", FieldSortInfo.Asc },
          { "CITY_NAME", FieldSortInfo.Desc }
        };
        tableView.SortAsync(dict);
      }
    
      // perform a custom sort via the UI
      if (tableView.CanCustomSort)
        tableView.CustomSort();
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.1 or higher.
    See Also