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

In This Topic
    SetHiddenFields Method (TableView)
    In This Topic
    Sets the specified fields to be hidden in the table view UI. The specified list of fields are added to any existing fields that are already hidden. To display all fields use ShowAllFields.
    Syntax
    public void SetHiddenFields( 
       List<string> fieldNames
    )
    Public Sub SetHiddenFields( _
       ByVal fieldNames As List(Of String) _
    ) 

    Parameters

    fieldNames
    Example
    Show or Hide Fields
    var tv = TableView.Active;
    if (tv == null)
      return;
    
    // get list of hidden fields
    var hiddenFields = tv.GetHiddenFields();
    
    
    // show all fields
    if (tv.CanShowAllFields)
      tv.ShowAllFields();
    
    
    
    // hide only "CITY_FIPS", "STATE_FIPS"
    if (tv.CanShowAllFields)
    {
      // show all fields
      tv.ShowAllFields();
      tv.SetHiddenFields(new List<string> { "CITY_FIPS", "STATE_FIPS" });
    }
    
    
    
    // add "STATE_NAME to set of hidden fields
    tv.SetHiddenFields(new List<string> { "STATE_NAME" });
    
    
    // hide selected fields
    if (tv.CanHideSelectedFields)
      tv.HideSelectedFields();
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also