<?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: Feature Layer update kills the save in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295415#M7607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jenn -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much. That solves my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am finding it somewhat frustrating to "discover" the order in which things execute. Is there a white paper or something somewhere where I could have discovered this myself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Feb 2011 18:28:55 GMT</pubDate>
    <dc:creator>DonFreeman</dc:creator>
    <dc:date>2011-02-14T18:28:55Z</dc:date>
    <item>
      <title>Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295411#M7603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a FeatureDataForm with and EditEnded handler like this.&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;private void MyFeatureDataForm_EditEnded(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; foreach (Layer lyr in MyMap.Layers)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lyr is FeatureLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayer featureLayer = lyr as FeatureLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.SaveEdits();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.Refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.Update();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;This cycles through all the FeatureLayers on the map and attempts to refresh them. Supposedly I only need the Update() command to do this but the SaveEdits() and Refresh() commands are in there for experimentation. I found that there is no benefit from the first 2, however if the Update() command is included the edit which was just made seems to get cancelled and nothing changes on the map or its data. Client caching is off and IsReadOnly is set to false. Anybody know what gives here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 21:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295411#M7603</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-02-11T21:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295412#M7604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want to save edits explicitly, you need to set AutoSave on the FeatureLayer to False. &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~AutoSave.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~AutoSave.html&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following documentation explains SaveEdits, Update and Refresh:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEdits.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEdits.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Refresh.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Refresh.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 21:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295412#M7604</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-02-11T21:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295413#M7605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you want to save edits explicitly, you need to set AutoSave on the FeatureLayer to False. &lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~AutoSave.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~AutoSave.html&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;The following documentation explains SaveEdits, Update and Refresh:&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEdits.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEdits.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Refresh.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Refresh.html&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Jenn -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THanks for jumping in on this one. I have tried all of those in about every combination you can think of. Presently, my layer looks like this&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer ID="AllAvailableFeatureLayer" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Url="http://gismaps.pagnet.org/ArcGIS/rest/services/testprojectALLBikeCounts/FeatureServer/0"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Renderer="{StaticResource AllRenderer}"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseLeftButtonUp="AllAvailableFeatureLayer_MouseLeftButtonUp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelectionColor="Yellow"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFields="Location,VolunteerAM,PhoneAM,EmailAM,SpanishAM,VolunteerPM,PhonePM,EmailPM,SpanishPM"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableClientCaching="True"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where="VolunteerAM = 'Available' and VolunteerPM = 'Available'"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoSave="True"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer.MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border CornerRadius="10" BorderBrush="SaddleBrown" BorderThickness="3" Margin="0,0,15,15" Background="LightGray"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Margin="7"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="Location: " Foreground="Black" FontWeight="Bold"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding [Location]}" Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Border&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:FeatureLayer.MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:FeatureLayer&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Note AutoSave is true. The code behind that I think should work looks like this&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void MyFeatureDataForm_EditEnded(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; foreach (Layer lyr in MyMap.Layers)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lyr is FeatureLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayer featureLayer = lyr as FeatureLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.Update();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;However, with this code the save does not even work. If I comment out the Update(), the save DOES work. Strange right? As I thought about this over the weekend I wondered if maybe the save is working but the Update() is somehow causing a second save and restoring the original data from a cache somewhere. Could that be possible?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295413#M7605</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2021-12-11T14:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295414#M7606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FeatureDataForm's EditEnded event fires before FeatureLayer's EndSaveEdits. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The changes made in the layer need to be pushed to the server before you can re-query the service. You can call Update() in EndSaveEdits eventhandler but also know that any change on the layer cause your application to re-query the service which is expensive. You can maybe use a boolean to flag whether the attribute that was changed need to call update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 16:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295414#M7606</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-02-14T16:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295415#M7607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jenn -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much. That solves my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am finding it somewhat frustrating to "discover" the order in which things execute. Is there a white paper or something somewhere where I could have discovered this myself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 18:28:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295415#M7607</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-02-14T18:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer update kills the save</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295416#M7608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can go through the API's Library Reference &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/webtoc.html#"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/webtoc.html#&lt;/A&gt;&lt;SPAN&gt; and go through the samples. I'll ask around if we have other online documentation that can help you see order of events or general workflow.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 21:23:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-update-kills-the-save/m-p/295416#M7608</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-02-14T21:23:56Z</dc:date>
    </item>
  </channel>
</rss>

