ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ITablePane Interface / ActiveObjectID Property
Example

In This Topic
    ActiveObjectID Property (ITablePane)
    In This Topic
    Gets the ObjectID of the active row in the table. The value of the row can be null, when the table does not have object ids, the active row is the new row, or the data for the row has not been loaded.
    Syntax
    ReadOnly Property ActiveObjectID As Nullable(Of Long)
    Nullable<long> ActiveObjectID {get;}
    Example
    Retrieve the values of selected cell in the attribute table
    {
        {
            if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane)
            {
                var mapMember = tablePane.MapMember;
                //Get the active row's object ID from the table pane
                var oid = tablePane.ActiveObjectID;
                if (oid.HasValue && oid.Value != -1 && mapMember != null)
                {
                    //Get the field of the active column
                    var activeField = tablePane.ActiveColumn;
                    QueuedTask.Run(() =>
                    {
                        // TODO: Use core objects to retrieve record and get value
                    });
                }
            }
        }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also