Select to view content in your preferred language

Editor widget not working

663
1
03-05-2013 06:47 AM
DonFreeman
Emerging Contributor
Hi -
My page has a map, datagrid, and an editor widget. The map shows point features (featurelayer) from an sde database (SQL Express). The attribute data can be successfully edited using the datagrid. The editor widget allows me to place a new point on the map and pops up the list of attributes to be filled in. After completing the attributes and clicking Apply, everything appears normal. However, if I then click the save button on the widget, the new point disappears and no data is saved.

Can anyone sugggest what I might be missing?
Thanks

<esri:EditorWidget x:Name="MyEditorWidget"
                             Map="{Binding ElementName=MyMap}" 
                                      Width="300" 
                                      AutoSelect="False"
                                      GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>


  private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e)
  {
   foreach (Layer lyr in MyMap.Layers)
   {
    if (lyr is FeatureLayer)
    {
     FeatureLayer featureLayer = lyr as FeatureLayer;
     featureLayer.Update();
    }
   }
  }

  private void EditorWidget_Loaded(object sender, RoutedEventArgs e)
  {
   string[] myLayerIDs = { "AllAvailableLayer" };
   MyEditorWidget.LayerIDs = myLayerIDs;
  }
0 Kudos
1 Reply
DonFreeman
Emerging Contributor
As a followup to this, Using the widget I can delete a feature and I can edit the attributes of a feature. I just cannot add a feature or move a feature.
😞
0 Kudos