Select to view content in your preferred language

Editor.CancelActive behavior changed from 2.1rc to release

744
3
03-17-2011 05:50 AM
IdoFlatow
Emerging Contributor
In the 2.1rc version when I called CancelActive on the editor, the edit ended with a "cancel" action, but the graphics changed according to my last change.

In the 2.1 release, when I call CancelActive, the graphics reverts to its original geometry.

I'm not using the editor widget but rather my own code, and I want to be able to control both edit mode and edit end mode. For example:
1. click of a graphics to enter edit vertices mode
2. change the vertices
3. click on a button to end edit mode

I know I can press inside the graphics to end edit mode, but I want to control it myself. Until the release I used CancelActive (as I was told to in this forum), but now CancelActive cancels the edit.

I've looked at the other commands, and non seems to match what I need.

How can I end an edit manually by code?
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
This is related thread: http://forums.arcgis.com/threads/26034-Unable-to-save-edits-to-graphics-on-GraphicsLayer-using-Edito...

You are right that this behavior changed from previous version of the API. This change was introduced as had been requested from this forum thread: http://forums.arcgis.com/threads/15508-Cancel-Edition-when-using-ContinuousMode
0 Kudos
IdoFlatow
Emerging Contributor
Thanks. I have a followup question - in the answer to the previous thread you wrote:
This is the intended behavior. When you activate another command before completing the edit, the uncommitted geometry change will be lost. To complete the edit, you click on the geometry being edited or click on another feature.


Some of my geometries are point geometries. To allow editing them and moving them, I transform them to MultiPoint which contains one point - this enables me to move the geometry, but I cannot click it to stop the editing.

Is there no method for the Editor class that tells it to stop editing?
0 Kudos
JenniferNery
Esri Regular Contributor
Moving a point geometry using Editor.EditVertices command does not require you to change the geometry to multi-point geometry first. To move a point, you activate EditVertices command and drag the feature. You can try this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget. The EditorWidget use Editor.EditVertices too for moving/editing geometry.

Moving a point, unlike moving/editing polyline/polygon/envelope geometries is committed as soon as the geometry is moved. I should have clarified that on my other post.

To stop an edit, you can use CancelActive command. This will undo changes on the geometry that were not committed.
0 Kudos