Select to view content in your preferred language

Editor Widget

2242
2
08-29-2011 01:00 PM
JerryBiedenbender
Emerging Contributor
Does anyone have a set of step by step instructions on how to set up the editor widget with my own feature service?

Thanks,
Jerry
0 Kudos
2 Replies
SanajyJadhav
Deactivated User
Here is how we used it.

1. Added Editor Widget in xaml.
2. We added feature service in code behind and explicitly initialized it.
3. In the initialized event, pasted following code
[PHP]
#region For editing

                currentApps.Tools.EditorWidget.Map = currentApps.MapXaml.MyMap;
                    currentApps.Tools.EditorWidget.LayerIDs = currentApps.EditalbleLyrIDs;
                    currentApps.Tools.EditorWidget.GeometryServiceUrl = currentApps.WebconfigVrbls.GeomServiceURL;
                    currentApps.Tools.EditorWidget.Continuous = false;
                    currentApps.Tools.EditorWidget.ShowAttributesOnAdd = true;
                    currentApps.Tools.EditorWidget.AutoComplete = true;
                    currentApps.Tools.EditorWidget.EditCompleted += new EventHandler<Editor.EditEventArgs>(EditorWidget_EditCompleted);

                #endregion For editing
[/PHP]

4. Widget is ready to use.

Hope this helps.
0 Kudos
JenniferNery
Esri Regular Contributor
In addition to Sanjay's response. You can look at this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget
XAML-code: I highlighted the two properties Map and GeometryServiceUrl because they are the most basic. EditorWidget will act on GraphicsLayer/FeatureLayers with ID in your map control. If you need to further include/exclude layers, you can set LayerIDs property. To allow operations such as Add/Cut/Reshape/Union/EditVertices, you will need to provide your own GeometryService.
<esri:EditorWidget x:Name="MyEditorWidget"
                             Map="{Binding ElementName=MyMap}" 
                                      Width="300" 
                                      AutoSelect="False"
                                      AlwaysDisplayDefaultTemplates="True" 
                                      GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>

This doc explains the other properties that you may want to set: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.To...
0 Kudos