ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TableView Class / SetSelectedFields Method
Example

In This Topic
    SetSelectedFields Method (TableView)
    In This Topic
    Sets the specified fields to be selected in the table view.
    Syntax
    public void SetSelectedFields( 
       List<string> fieldNames
    )
    Public Sub SetSelectedFields( _
       ByVal fieldNames As List(Of String) _
    ) 

    Parameters

    fieldNames
    Example
    Select Fields
    var tv = TableView.Active;
    if (tv == null)
      return;
    
    // get selected fields
    var selectedfields = tv.GetSelectedFields();
    
    // set selected fields
    tv.SetSelectedFields(new List<string> { "CITY_FIPS", "STATE_FIPS" });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also