<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FeatureLayer editing - Add feature in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361965#M9339</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From the sample link you provided, the EditorWidget is set up this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt; &amp;lt;esri:EditorWidget x:Name="MyEditorWidget"&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;Map="{Binding ElementName=MyMap}" &lt;/SPAN&gt; &lt;BR /&gt; Width="300"&amp;nbsp;&amp;nbsp; &lt;BR /&gt; AutoSelect="False"&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;&lt;SPAN&gt;GeometryServiceUrl="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;BR /&gt; ShowAttributesOnAdd="True"&amp;nbsp;&amp;nbsp; &lt;BR /&gt; Loaded="EditorWidget_Loaded"/&amp;gt;&amp;nbsp; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The EditorWidget properties that need to be set at minimum are Map and GeometryServiceUrl. However, if your map does not contain GraphicsLayer or FeatureLayer with ID, all buttons will be disabled. If GeometryServiceUrl has not been specified then commands that may need them (Add, Union, Cut, Reshape, EditVertices) will also be disabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your other question, if you want to customize the look and feel of the EditorWidget, it can be done the same way as the other controls. Please see this blog post: &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The FeatureDataForm that is displayed on a ChildWindow after an Add is completed or DisplayAttribute is clicked use the default style. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want more control of how the fields are displayed, you can do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Set EditorWidget ShowAttributesOnAdd to False.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Subscribe to EditorWidget.EditCompleted&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Use customized FeatureDataForm or use your own UserControl to display attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void MyEditorWidget_EditCompleted(object sender, Editor.EditEventArgs e)
{
 if (e.Action == Editor.EditAction.Add)
 {
&amp;nbsp; foreach (Editor.Change change in e.Edits)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (change.Layer != null &amp;amp;&amp;amp; change.Layer is FeatureLayer &amp;amp;&amp;amp; change.Graphic != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayer featureLayer = change.Layer as FeatureLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowAttributeForm(featureLayer, change.Graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
}

private void ShowAttributeForm(FeatureLayer featureLayer, Graphic graphic)
{
 ChildWindow window = new ChildWindow();
&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt; FeatureDataForm form = new FeatureDataForm()
 {
&amp;nbsp; GraphicSource = graphic,
&amp;nbsp; FeatureLayer = featureLayer,
&amp;nbsp; IsReadOnly = featureLayer.IsReadOnly
 };
 window.Content = form;&lt;/SPAN&gt;
 form.EditEnded += (s, e) =&amp;gt; { window.Close(); };
 window.Show();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code in red above can be replaced with another UserControl or maybe set FeatureDataForm style.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:52:51 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2021-12-11T16:52:51Z</dc:date>
    <item>
      <title>FeatureLayer editing - Add feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361964#M9338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The sample shown at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget&lt;/A&gt;&lt;SPAN&gt; demonstrates how to add and delete features from a FeatureLayer but is very incomplete in its description. For example, I have a map with 4 editable FeatureLayers. I am able to edit their attributes successfully. However, after creating a Geometry service and adding the EditorWidget to the page, the widget appears empty with no symbols and no apparent functionality. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question is, what's happening here and is there a better description somewhere on how to set this up?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;errata - Please disregard my original request. (I had the layer name spelled wrong. 20 whacks with a wet noodle) But I do have another question. How do I customize this thing? Like the presentation of the fields to be edited.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 14:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361964#M9338</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-03-03T14:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer editing - Add feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361965#M9339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From the sample link you provided, the EditorWidget is set up this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt; &amp;lt;esri:EditorWidget x:Name="MyEditorWidget"&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;Map="{Binding ElementName=MyMap}" &lt;/SPAN&gt; &lt;BR /&gt; Width="300"&amp;nbsp;&amp;nbsp; &lt;BR /&gt; AutoSelect="False"&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;&lt;SPAN&gt;GeometryServiceUrl="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;BR /&gt; ShowAttributesOnAdd="True"&amp;nbsp;&amp;nbsp; &lt;BR /&gt; Loaded="EditorWidget_Loaded"/&amp;gt;&amp;nbsp; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The EditorWidget properties that need to be set at minimum are Map and GeometryServiceUrl. However, if your map does not contain GraphicsLayer or FeatureLayer with ID, all buttons will be disabled. If GeometryServiceUrl has not been specified then commands that may need them (Add, Union, Cut, Reshape, EditVertices) will also be disabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your other question, if you want to customize the look and feel of the EditorWidget, it can be done the same way as the other controls. Please see this blog post: &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The FeatureDataForm that is displayed on a ChildWindow after an Add is completed or DisplayAttribute is clicked use the default style. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want more control of how the fields are displayed, you can do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Set EditorWidget ShowAttributesOnAdd to False.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Subscribe to EditorWidget.EditCompleted&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Use customized FeatureDataForm or use your own UserControl to display attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void MyEditorWidget_EditCompleted(object sender, Editor.EditEventArgs e)
{
 if (e.Action == Editor.EditAction.Add)
 {
&amp;nbsp; foreach (Editor.Change change in e.Edits)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (change.Layer != null &amp;amp;&amp;amp; change.Layer is FeatureLayer &amp;amp;&amp;amp; change.Graphic != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayer featureLayer = change.Layer as FeatureLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowAttributeForm(featureLayer, change.Graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
}

private void ShowAttributeForm(FeatureLayer featureLayer, Graphic graphic)
{
 ChildWindow window = new ChildWindow();
&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt; FeatureDataForm form = new FeatureDataForm()
 {
&amp;nbsp; GraphicSource = graphic,
&amp;nbsp; FeatureLayer = featureLayer,
&amp;nbsp; IsReadOnly = featureLayer.IsReadOnly
 };
 window.Content = form;&lt;/SPAN&gt;
 form.EditEnded += (s, e) =&amp;gt; { window.Close(); };
 window.Show();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code in red above can be replaced with another UserControl or maybe set FeatureDataForm style.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:52:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361965#M9339</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T16:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer editing - Add feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361966#M9340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jenn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Very helpful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 16:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-editing-add-feature/m-p/361966#M9340</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-03-03T16:35:58Z</dc:date>
    </item>
  </channel>
</rss>

