<?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: Problem selecting features from a Feature Layer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34473#M900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you edit a feature returned by QueryTask, you are not affecting the same instance contained in your FeatureLayer. You need to edit features from your FeatureLayer.Graphics. Maybe make a comparison (LINQ query?) in the ExecuteCompleted event to get the actual graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if you have to call EditVertices in code, know that this is only supported for Polyline and Polygon geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
string objId = MyFeatureLayer.LayerInfo.ObjectIdField;
Graphic graphic = from MyFeatureLayer.Graphics
&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; where g.Attributes[objId] == e.FeatureSet.Attributes[objId]
&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; select g;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
if(Editor.EditVertices.CanExecute(graphic))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Editor.EditVertices.Execute(graphic)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To know if the edit is applied on your FeatureLayer, you can subscribe to the following events:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~EndSaveEdits_EV.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~EndSaveEdits_EV.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~SaveEditsFailed_EV.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEditsFailed_EV.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If edits seem to complete and save properly but you are not able to see the changes, set DisableClientCaching to true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~DisableClientCaching.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~DisableClientCaching.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:20:26 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2021-12-10T21:20:26Z</dc:date>
    <item>
      <title>Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34472#M899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm trying to do is link to feature from a database, so I search for features using a query task and get returned a feature set. What I need to do then is select the returned feature,(there should only be one), and then start editing its vertices.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an Editor object and i should be able to use Editor.EditVertices.Execute("myGraphic"). However I get an argument exception when I do this. It seems that when I select the feature, I'm not selecting the feature on the layer, just a copy of it. So my question is, what is the best way to programmatically select a feature based on an attribute, from a feature layer, so that I can then pass that feature to the edit vertices method ? Any suggestions would be greatly appreciated, I'm probably missing something obvious ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Grant&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Dec 2010 20:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34472#M899</guid>
      <dc:creator>GrantCarroll</dc:creator>
      <dc:date>2010-12-05T20:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34473#M900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you edit a feature returned by QueryTask, you are not affecting the same instance contained in your FeatureLayer. You need to edit features from your FeatureLayer.Graphics. Maybe make a comparison (LINQ query?) in the ExecuteCompleted event to get the actual graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if you have to call EditVertices in code, know that this is only supported for Polyline and Polygon geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
string objId = MyFeatureLayer.LayerInfo.ObjectIdField;
Graphic graphic = from MyFeatureLayer.Graphics
&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; where g.Attributes[objId] == e.FeatureSet.Attributes[objId]
&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; select g;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
if(Editor.EditVertices.CanExecute(graphic))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Editor.EditVertices.Execute(graphic)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To know if the edit is applied on your FeatureLayer, you can subscribe to the following events:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~EndSaveEdits_EV.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~EndSaveEdits_EV.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~SaveEditsFailed_EV.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~SaveEditsFailed_EV.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If edits seem to complete and save properly but you are not able to see the changes, set DisableClientCaching to true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~DisableClientCaching.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~DisableClientCaching.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34473#M900</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T21:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34474#M901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the code, I was getting and invalid cast error when trying to return the result to the a Graphic. I can get around this by assigning the result to an IEnumerable(Of Graphic) (Which works). However it looks as though the number of features being returned is being limited to 1000. I can prove this by running through the graphics on the layer and watching it exit at the loop after 1000 iterations. The feature I have been testing against has an ObjectID of 1406 so it seems its not being pulled through, as the count on the IEnumerable is 0. When I hard code the ObjectID to 1, it works though and pulls back a Graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I guess the next question is, how do I ensure I'm selecting over all features rather than just the first 1000 in a layer. I have tried increasing the OnDemandCache size but it doesn't seem to help. Any further help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again thanks for the code, I was sure there would be a way to do it with something like LINQ, but I'm not the skilled with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 17:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34474#M901</guid>
      <dc:creator>GrantCarroll</dc:creator>
      <dc:date>2010-12-06T17:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34475#M902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh sorry I missed that. You are right the LINQ query will return an IEnumerable&amp;lt;Graphics&amp;gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the QueryTask must return one graphic and you want to get the graphic with the same ID from the FeatureLayer, is that right? If this is the case the same code applies with slight modification:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
string objId = MyFeatureLayer.LayerInfo.ObjectIdField;
object id = e.FeatureSet.Attributes[objId];
Graphic graphic = (from MyFeatureLayer.Graphics
&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; where g.Attributes[objId] == id
&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; select g).First();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
if(Editor.EditVertices.CanExecute(graphic))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Editor.EditVertices.Execute(graphic)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While in debug mode, check if "id" has the expected value. Make sure that the Query OutFields include the ObjectIdField.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your FeatureLayer is OnDemand Mode? You can refer to this help doc to find which QueryMode to use: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer+QueryMode.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer+QueryMode.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34475#M902</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T21:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34476#M903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the updated Code. It works nicely, however I still have the issue where it looks like the Feature Layer is not searching over all features, only the first 1000. Am I missing a parameter or something here ? When I look at the layer in ArcMap it has 2119 features, but when I look at Count field of GraphicsCollection associated with the Feature Layer, its only 1000. It almost seems like its being limited to this. I have set the mode to snapshot also, so it should be grabbing all the features ?? Also I am returning all fields and as I said when I hard code an objectid of "1" the LINQ query works, it just seems like it won't return anythign with an ObjectID over 1000. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again thanks for all the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 18:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34476#M903</guid>
      <dc:creator>GrantCarroll</dc:creator>
      <dc:date>2010-12-06T18:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34477#M904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is because you have hit the maximum number of records that could be returned by your service (default is 1000 in version 10). You can either increase this value using Server Manager (under "Parameters" tab look for "Maximum Number of Records Returned by Server" at the end of the panel) or use the OnDemand mode for your FeatureLayer (see SDK sample here: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerOnDemand"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerOnDemand&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 19:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34477#M904</guid>
      <dc:creator>AliMirzabeigi</dc:creator>
      <dc:date>2010-12-06T19:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem selecting features from a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34478#M905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect !!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you both so much, you have saved me a lot of head banging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers and have a good xmas.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 19:25:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-selecting-features-from-a-feature-layer/m-p/34478#M905</guid>
      <dc:creator>GrantCarroll</dc:creator>
      <dc:date>2010-12-06T19:25:12Z</dc:date>
    </item>
  </channel>
</rss>

