ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TableView Class / SetFieldOrderAsync Method
Example

In This Topic
    SetFieldOrderAsync Method (TableView)
    In This Topic
    Sets the field order in the table view according to the specified set of field names.
    Syntax
    public Task SetFieldOrderAsync( 
       List<string> fieldNames
    )
    Public Function SetFieldOrderAsync( _
       ByVal fieldNames As List(Of String) _
    ) As Task

    Parameters

    fieldNames
    Remarks
    The fieldNames can contain a subset of the fields in the MapMember. These fields will be ordered first. All remaining visible fields in the MapMember will follow in their default display order.
    Example
    Set Field Order
    var tv = TableView.Active;
    if (tv == null)
      return;
    
    if (tv.CanResetFieldOrder)
    {
      tv.ResetFieldOrder();
    
      var fldOrder = new List<string>();
      fldOrder.Add("STATE_NAME");
      fldOrder.Add("STATE_FIPS");
      await tv.SetFieldOrderAsync(fldOrder);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also