ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMDisplayTable Class / DisplayField Property
Example

In This Topic
    DisplayField Property (CIMDisplayTable)
    In This Topic
    Gets or sets the name of the attribute field that will be used as a label that represents each row in the table. The display field must be able to be represented as a string (string or numeric).
    Syntax
    public string DisplayField {get; set;}
    Public Property DisplayField As String
    Example
    Access the display field for a layer
    var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      // get the CIM definition from the layer
      var cimFeatureDefinition = featureLayer.GetDefinition() as ArcGIS.Core.CIM.CIMBasicFeatureLayer;
      // get the view of the source table underlying the layer
      var cimDisplayTable = cimFeatureDefinition.FeatureTable;
      // this field is used as the 'label' to represent the row
      var displayField = cimDisplayTable.DisplayField;
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also