It seems that the RowCreatedEvent is triggered on a different moment than with the RowChangedEvent and RowDeletedEvent. The Changed & Deleted ones, are triggered before the actual changes are sent to the database/server. In the Created case, it seems like there is an interaction with the database or server first.
We assume it might be related to some of the ObjectID logic that needs to run fist (e.g. fetch next OID) !?
Also, maybe related, the CancelEdit doesn't seem to have effect in case of the RowCreatedEvent.
This leads to troubles as we are using the Row...Events to include some validation and data enrichment.
Is this intended? For us it seems that the design for the Row...Events is not consistent:
- We should be able to use the CancelEdit on RowChangedEventArgs
- It introduces extra inconsistency and difficulty in case of and SOE or SOI, where we miss the enriched data in case of a 'Create'.
Can you provide some more information please on the data source your seeing this on (filegdb, sde, or feature service and any versioning involved). How are you creating the features, through code or the UI?
I'm editing the Feature Service directly from ArcGIS Pro. The Feature Service was published from a rather simple dataset (polyline feature class). No versioning enabled.
For creating a feature, I'm using the standard edit tools from ArcGIS Pro. So through the UI currently. There is a plan to automate some feature creation too, if possible via the AddIn. .e.g. A polyline of a given length, with a given sub_type as data field.
I can confirm the things you are seeing.
For a feature service:
OnCreate fires after the feature is created and CancelEdit has no effect.
OnChange fires correctly. CancelEdit fails for Move/Rotate/Scale and Transform which share a similar code path. Other changes such as edit vertices and reshape can be canceled correctly.
OnDelete fires and can be canceled.
We'll work on these.