ArcGIS Pro 3.7 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 Overridable Function GetOriginalValue( _
       ByVal index As Integer _
    ) As Object
    public virtual object GetOriginalValue( 
       int index
    )

    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
    // Set up a listener for row change events on the table associated with the
    // provided feature layer. The event subscription occurs within a queued task to ensure thread safety.
    await QueuedTask.Run(() =>
     {
       //Listen to the RowChangedEvent that occurs when a Row is changed.
       var modifiedFeatureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); ;
       RowChangedEvent.Subscribe(rowChangedEventArgs =>
         {
           // 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 = modifiedFeatureLayer.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 = rowChangedEventArgs.Row.GetOriginalValue(shapeIndex) as Geometry;
           //New geometry of the modified row
           var geomNew = rowChangedEventArgs.Row[shapeIndex] as Geometry;
           //Compare the two
           bool shapeChanged = geomOrig.IsEqual(geomNew);
           if (shapeChanged)
           {
             // The geometry has not changed
             Console.WriteLine("Geometry has not changed");
           }
           else
           {
             // The geometry has changed
             Console.WriteLine("Geometry has changed");
           }
         }, modifiedFeatureLayer.GetTable());
     });
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also