ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Editing.Events Namespace / RowChangedEventArgs Class / Guid Property
Example

In This Topic
    Guid Property (RowChangedEventArgs)
    In This Topic
    Gets the guid that uniquely identifies the EditOperation.
    Syntax
    public Guid Guid {get;}
    Public ReadOnly Property Guid As Guid
    Example
    Modify a record within Row Events - using Row.Store
    private void HookRowChangedEvent()
    {
      // subscribe to the RowChangedEvent
      Table table = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault().GetTable();
      RowChangedEvent.Subscribe(OnRowChangedEvent, table);
    }
    
    private Guid _currentRowChangedGuid = Guid.Empty;
    protected void OnRowChangedEvent(RowChangedEventArgs args)
    {
      // RowEvent callbacks are always called on the QueuedTask so there is no need 
      // to wrap your code within a QueuedTask.Run lambda.
    
      var row = args.Row;
    
      // check for re-entry  (only if row.Store is called)
      if (_currentRowChangedGuid == args.Guid)
        return;
    
      var fldIdx = row.FindField("POLICE_DISTRICT");
      if (fldIdx != -1)
      {
        //Validate any change to �police district�
        //   cancel the edit if validation on the field fails
        if (row.HasValueChanged(fldIdx))
        {
          // cancel edit with invalid district (5)
          var value = row["POLICE_DISTRICT"].ToString();
          if (value == "5")
          {
            //Cancel edits with invalid �police district� values
            args.CancelEdit($"Police district {row["POLICE_DISTRICT"]} is invalid");
          }
        }
    
        // update the description field
        row["Description"] = "Row Changed";
    
        //  this update with cause another OnRowChanged event to occur
        //  keep track of the row guid to avoid recursion
        _currentRowChangedGuid = args.Guid;
        row.Store();
        _currentRowChangedGuid = Guid.Empty;
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also