Select to view content in your preferred language

Is there any way to get a reference to all unsaved edits in a featurelayer?

1692
5
01-03-2011 11:27 PM
EinarKløvstad
Deactivated User
Is there any way to get a reference to all unsaved edits in a featurelayer?
0 Kudos
5 Replies
AliMirzabeigi
Emerging Contributor
You can subscribe to "BeginSaveEdits" event of the FeatureLayer; in "BeginEditEventArgs" parameter of the handler check for "Adds", "Deletes", and "Updates", i.e. e.Adds, e.Deletes, e.Updates respectively.
0 Kudos
by Anonymous User
Not applicable
Original User: w3webster

Thanks Ali
That is what I am currently doing, but I must confess I rather not do that bookkeeping myself especially since the collection obviously must be kept by the featurelayer (or its parent).
The reason I need this, is to do custom validation of the edits before they are saved. I imagine that that  is quite a common task. Is there any plans to open the API to get hold of that collection?
0 Kudos
dotMorten_esri
Esri Notable Contributor
There is no way to get to a collection of 'edits'.
I suggest you do the validation of the edit before the edit itself is pushed to the feature layer.

What type of validation are you trying to perform?
0 Kudos
by Anonymous User
Not applicable
Original User: w3webster

Validations we do:
First of all: different users can only edit in their own areas. On top of that, some feature category�??s must be placed inside other features category�??s etc (this could be done by topology rules on the server, but for usability reasons we do want to validate this on the client)
0 Kudos
dotMorten_esri
Esri Notable Contributor
The editor is only meant for simple editing scenarios. For more advanced custom scenarios like this, I suggest you use the Draw class instead and handle the user input/validation. On draw completed, simply perform your validations then add the feature to the FeatureLayer. Ie myFeatureLayer.Graphics.Add(newlyAddedGraphic), and the feature will automatically get pushed back to the server.
0 Kudos