ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / Row Class / GetOriginalValue Method
The index of the field.
Example

In This Topic
    GetOriginalValue Method (Row)
    In This Topic
    Gets the original value of a field at the given index. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public virtual object GetOriginalValue( 
       int index
    )
    Public Overridable Function GetOriginalValue( _
       ByVal index As Integer _
    ) As Object

    Parameters

    index
    The index of the field.

    Return Value

    The value of the field.
    Exceptions
    ExceptionDescription
    The index argument is out of range.
    A geodatabase-related exception has occurred.
    index corresponds to a shape field index and the type of shape (i.e., geometry) is not supported.
    Remarks
    The index for the fields is zero based. If the Field.FieldType corresponding to the specified field index is FieldType.Blob, the value will be System.IO.MemoryStream.
    Example
    Determine if Geometry Changed while editing
    private static FeatureLayer featureLayer;
    private static void DetermineGeometryChange()
    {
      featureLayer = MapView.Active?.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
      if (featureLayer == null)
        return;
    
      QueuedTask.Run(() =>
      {
        //Listen to the RowChangedEvent that occurs when a Row is changed.
        ArcGIS.Desktop.Editing.Events.RowChangedEvent.Subscribe(OnRowChangedEvent2, featureLayer.GetTable());
      });
    }
    private static void OnRowChangedEvent2(RowChangedEventArgs args)
    {
      // RowEvent callbacks are always called on the QueuedTask so there is no need 
      // to wrap your code within a QueuedTask.Run lambda.
    
      //Get the layer's definition
      var lyrDefn = featureLayer.GetFeatureClass().GetDefinition();
      //Get the shape field of the feature class
      string shapeField = lyrDefn.GetShapeField();
      //Index of the shape field
      var shapeIndex = lyrDefn.FindField(shapeField);
      //Original geometry of the modified row
      var geomOrig = args.Row.GetOriginalValue(shapeIndex) as Geometry;
      //New geometry of the modified row
      var geomNew = args.Row[shapeIndex] as Geometry;
      //Compare the two
      bool shapeChanged = geomOrig.IsEqual(geomNew);
    }
    MapSeries_FindPageNumber
    //Return the page number that corresponds to the page name field for an index feature
    
    Layout layout = LayoutView.Active.Layout;
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      SpatialMapSeries SMS = layout.MapSeries as SpatialMapSeries;
      Row msRow = SMS.CurrentRow;
      System.Windows.MessageBox.Show(SMS.FindPageNumber(msRow.GetOriginalValue(msRow.FindField("NAME")).ToString()));
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also