ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TableView Class / GetField Method
The display index of the field.
Example

In This Topic
    GetField Method (TableView)
    In This Topic
    Gets the field at the given index.
    Syntax
    Public Function GetField( _
       ByVal index As Integer _
    ) As FieldDescription
    public FieldDescription GetField( 
       int index
    )

    Parameters

    index
    The display index of the field.

    Return Value

    The FieldDescription at the index.
    Example
    Field Access
    {
      // field access
      var flds = tableView.GetFields();
      var fldIdx = tableView.GetFieldIndex("STATE_NAME");
      var fldDesc = tableView.GetField(fldIdx);
    }
    Get or set the Active Field
    {
      // get active field, active field name
      var activeFieldIdx = tableView.ActiveFieldIndex;
      var fldDesc = tableView.GetField(activeFieldIdx);
      var fldName = fldDesc.Name;
    
      // set active field by name
      tableView.SetActiveField("STATE_NAME");
    
      // or set active field by index
      tableView.SetActiveField(3);
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also