ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TableView Class / ActiveRowIndex Property
Example

In This Topic
    ActiveRowIndex Property (TableView)
    In This Topic
    Gets the zero based index of the active row in the table. Can be -1 if there is no active row.
    Syntax
    Public ReadOnly Property ActiveRowIndex As Integer
    public int ActiveRowIndex {get;}
    Example
    Get the active row
    {
      // get the active row index
      int rowIndex = tableView.ActiveRowIndex;
    }
    Change the active row
    {
      // get the active row index
      int rowIndex = tableView.ActiveRowIndex;
    
      // move to a different row
      var newIndex = 10 + rowIndex;
      tableView.BringIntoView(newIndex);
    }
    Translate between rowIndex and objectID
    {
      // get the active row index
      int rowIndex = tableView.ActiveRowIndex;
      // increase
      int newIndex = rowIndex + 10;
      // get the objectID
      long newOID = tableView.GetObjectIdAsync(newIndex).Result;
    
      // get the rowIndex for a specific objectID
      //   2nd parameter indicates if the search only occurs for the pages loaded
      //   if pass false, then in the worst case, a full table scan will occur to 
      //    find the objectID.
      long OID = 100;
      var idx = tableView.GetRowIndexAsync(OID, true);
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also