Select to view content in your preferred language

Editor complete\stopedit

709
2
01-26-2012 04:58 AM
MatthewPilgrim
Regular Contributor
Hi,

I have extended the editor class to add the ability to edit text and bound it to my edit view.  However I can't seem to find a command that I can call to complete the current action (there is a CancelAction).  How can I get the Editor class to commit the users changes to the graphic when they press a button?

I ask, as clicking on the map/graphic doesn't seem to end the edit.  Clicking on another graphic does but this isn't helpful when you only have one on screen!

I note there is an EditGeometry class that has StopEdit.  Does this class build on the Editor Class.  Not sure what the realtionships between Editor, EditGeometry and EditorWidget is.

Thanks, Matt
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
If you are editing geometry and would like to have more control in code-behind on when to stop the edit, you can use EditGeometry. In your case, are you editing attribute? This SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsExplicitSave. Demonstrates how to use Editor.SaveEdits command. Since FeatureLayer.AutoSave=False, commiting the edits (geometry or attribute) need to be explicit. The button enables when there are edits waiting to be committed and OnClick, they get submitted to the server.
0 Kudos
MatthewPilgrim
Regular Contributor
Thanks Jennifer,

We are saving the graphics layer in another process so autosave is disabled.  The problem we have (in v2.2) is that after moving a vertex the edit is not completed by clicking on the shape or one of its lines (as in the example you pointed to).  I have looked and can't see any custom code responsible for this [bad] behaviour.  As a quick fix I wanted to add a 'Complete' button that would call something like StopEdit.  But this doesn't exist on the editor class.  Is EditGeometry inherited from the editor class?

UPDATE
This is our code for changing modes:
                       if (_EditMode == "MoveScale")
                        {
                            _ExtendedEditor.MoveEnabled = true;
                            _ExtendedEditor.ScaleEnabled = true;
                            _ExtendedEditor.EditVerticesEnabled = false;
                        }
                        else if (_EditMode == "EditVertex")
                        {
                            _ExtendedEditor.MoveEnabled = false;
                            _ExtendedEditor.ScaleEnabled = false;
                            _ExtendedEditor.EditVerticesEnabled = true;
                        }
It turns out that if I set MoveEnabled (highlighted) to true I can then click the shape to complete the vertex edit.

Is this as expected?

Matt
0 Kudos