<?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: Using Editor to select features, how to query for selections? in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509710#M2620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide an example of what you're suggesting? I think I understand what you're saying, but not sure. Currently what I was doing was that I would add the graphic returned by the query if it didn't exist in the Graphics collection. But then it looks like the graphic gets duplicated by the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: this is a dynamic feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var queryTask = new QueryTask(context.Layers.ActiveParcelLayer.Url);
queryTask.ExecuteCompleted += new EventHandler&amp;lt;QueryEventArgs&amp;gt;(queryTask_ExecuteCompleted);

var query = new Query();
query.OutFields.Add("*");
query.Source = layer.Source;
query.ReturnGeometry = true;
query.OutSpatialReference = map.SpatialReference;
query.Where = string.Format("PROP_ID in ({0})", string.Join(",", propIds));

var featureSet = queryTask.Execute(query);
if (featureSet != null)
{
 foreach (var feature in featureSet)
 {
&amp;nbsp; var propId = GisHelper.GetPropertyId(feature);
&amp;nbsp; var graphic = layer.Graphics.FirstOrDefault(
&amp;nbsp;&amp;nbsp; g =&amp;gt;&amp;nbsp; GisHelper.GetPropertyId(g) == propId
&amp;nbsp; );
&amp;nbsp; if (graphic == null)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; graphic = feature;
&amp;nbsp;&amp;nbsp; layer.Graphics.Add(graphic);
&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; graphic.Selected = true;
 }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:19:38 GMT</pubDate>
    <dc:creator>GeorgeFaraj</dc:creator>
    <dc:date>2021-12-11T22:19:38Z</dc:date>
    <item>
      <title>Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509697#M2607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using Editor for selecting features in my map. Now I want to retrieve the features that are selected, how can I do this? Also, is there a way to add features to the selection using code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 14:56:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509697#M2607</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-08T14:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509698#M2608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found FeatureLayer.SelectedGraphics, and this seems to work when I use the Editor to select features. But now I'm trying to select features through code, by using a QueryTask and setting the Selected property to true for the results. The FeatureLayer.SelectedGraphics collection does not get updated if I do this, and the features do not appear selected in the map. What am I missing 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>Thu, 10 Jan 2013 12:38:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509698#M2608</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-10T12:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509699#M2609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone tell me how to select features through code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 14:28:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509699#M2609</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-14T14:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509700#M2610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "SR_ID = '" + requestID + "'"; //REQUESTID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //execute query&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.getLayer(yourLayerId).selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (features.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; features.length; i++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&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; //do your coding&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//for&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//if&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 16:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509700#M2610</guid>
      <dc:creator>cristiBJ</dc:creator>
      <dc:date>2013-01-14T16:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509701#M2611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For example:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "SR_ID = '" + requestID + "'"; //REQUESTID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //execute query&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.getLayer(yourLayerId).selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (features.length &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; features.length; i++) {&lt;BR /&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; //do your coding&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//for&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//if&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to do this in C#/WPF.&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 Jan 2013 17:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509701#M2611</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-14T17:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509702#M2612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Charles,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There could be a number of reasons for this, perhaps you could post the code for QueryTask and QueryTask_ExecuteCompleted?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the QueryTask samples in the SDK Sample app are pretty comprehensive - looks like the Attribute Query example is what you are trying to replicate to some extent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 20:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509702#M2612</guid>
      <dc:creator>MatthewBrown1</dc:creator>
      <dc:date>2013-01-15T20:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509703#M2613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public void SelectProperties(IEnumerable&amp;lt;int&amp;gt; propIds)
{
 UnselectAll();

 if (context.Layers.ActiveParcelLayer != null)
 {
&amp;nbsp; if (propIds.Count() &amp;gt; 0)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask(context.Layers.ActiveParcelLayer.Url);
&amp;nbsp;&amp;nbsp; queryTask.ExecuteCompleted += new EventHandler&amp;lt;QueryEventArgs&amp;gt;(queryTask_ExecuteCompleted);

&amp;nbsp;&amp;nbsp; var query = new Query();
&amp;nbsp;&amp;nbsp; query.Where = string.Format("PROP_ID in ({0})", string.Join(",", propIds));

&amp;nbsp;&amp;nbsp; var featureSet = queryTask.Execute(query);
&amp;nbsp;&amp;nbsp; if (featureSet != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var feature in featureSet)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.Selected = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; context.Layers.ActiveParcelLayer.Refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp; OnSelectionChanged();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
 }
 else
 {
&amp;nbsp; pendingSelection = new List&amp;lt;int&amp;gt;(propIds);
 }
}

void queryTask_ExecuteCompleted(object sender, QueryEventArgs e)
{
 foreach (var feature in e.FeatureSet)
 {
&amp;nbsp; feature.Selected = true;
 }

 context.Layers.ActiveParcelLayer.Refresh();
 OnSelectionChanged();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The QueryTask returns a set of features, and they have the right attribute values, but setting their Selected property to true (or calling the Select() method) is not doing anything that I can see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:19:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509703#M2613</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-11T22:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509704#M2614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Charles,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it might be an idea to first alter the foreach in ExecutedComplete to add the result to a graphics layer. This seems to be the easiest method to use and the graphics will still have attributes that you can manipulate or display.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you'll have something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

foreach (var feature in e.FeatureSet)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add graphics to a GraphicsLayer you have already created
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // e.g. GraphicsLayer graphicsLayer = new GraphicsLayer();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.Graphics.Add(feature);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

// Add layer to map
map.Layers.Add(graphicsLayer);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can implement ZoomTo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

// Zoom to selected features (define expand percentage)
Envelope selectedFeatureExtent = graphicsLayer.FullExtent.Extent;

double expandPercentage = 30;
double widthExpand = selectedFeatureExtent.Width * (expandPercentage / 100);
double heightExpand = selectedFeatureExtent.Height * (expandPercentage / 100);

ESRI.ArcGIS.Client.Geometry.Envelope displayExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtent.XMin - (widthExpand / 2),
selectedFeatureExtent.YMin - (heightExpand / 2),
selectedFeatureExtent.XMax + (widthExpand / 2),
selectedFeatureExtent.YMax + (heightExpand / 2));

map.ZoomTo(displayExtent);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I said, this is pretty simple and you may have to take a different approach if your workflow is complicated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:19:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509704#M2614</guid>
      <dc:creator>MatthewBrown1</dc:creator>
      <dc:date>2021-12-11T22:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509705#M2615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;But adding them to another layer wouldn't get them to be listed in the SelectedGraphics collection of my feature layer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an Editor assigned to my map, and the user can select features using their mouse. This all works nicely and the SelectedGraphics collection of the layer gets updated perfectly. All I want to do now is do this through code. After that, the user could use the Editor to add more features to the selection.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 13:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509705#M2615</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-17T13:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509706#M2616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have an Editor assigned to my map, and the user can select features using their mouse. This all works nicely and the SelectedGraphics collection of the layer gets updated perfectly. All I want to do now is do this through code. After that, the user could use the Editor to add more features to the selection.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you elaborate on this? Do you have a use case/user story? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use an on click event to capture the subsequent user selection and add that to the graphics layer holding the query result. But I wonder if query task is actually the best option. Manipulating the graphics layer for the feature service layer might be better.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 19:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509706#M2616</guid>
      <dc:creator>MatthewBrown1</dc:creator>
      <dc:date>2013-01-17T19:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509707#M2617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can you elaborate on this? Do you have a use case/user story?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an Editor set on my map, and have a toolbar that activates the editor for selection purposes only. The user will select features, then they can right-click and perform actions on the selected features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's also a "search" tool where the user can enter some criteria and the resulting graphics should get selected. The user can now right-click and perform the same actions as above on those selections.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 20:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509707#M2617</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-01-17T20:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509708#M2618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although the Editor is selecting the graphics/features, the actual selections exist in the layers. You can use the Editor.GraphicsLayers property to get a list of all the GraphicsLayers/FeatureLayers with which the Editor control is interacting then iterate their selection sets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 14:04:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509708#M2618</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2013-02-20T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509709#M2619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp;&amp;nbsp; if (featureSet != null)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var feature in featureSet)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.Selected = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.Layers.ActiveParcelLayer.Refresh();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnSelectionChanged();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The features returned by the query tasks and the features of your graphics layer are not the same, so setting feature.Selected to true has no effect on the feature in the graphics layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you should use the ObjectId to retrieve the features of the graphics layer having the same objectId as the features returned by your query.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 16:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509709#M2619</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-02-20T16:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509710#M2620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide an example of what you're suggesting? I think I understand what you're saying, but not sure. Currently what I was doing was that I would add the graphic returned by the query if it didn't exist in the Graphics collection. But then it looks like the graphic gets duplicated by the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: this is a dynamic feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var queryTask = new QueryTask(context.Layers.ActiveParcelLayer.Url);
queryTask.ExecuteCompleted += new EventHandler&amp;lt;QueryEventArgs&amp;gt;(queryTask_ExecuteCompleted);

var query = new Query();
query.OutFields.Add("*");
query.Source = layer.Source;
query.ReturnGeometry = true;
query.OutSpatialReference = map.SpatialReference;
query.Where = string.Format("PROP_ID in ({0})", string.Join(",", propIds));

var featureSet = queryTask.Execute(query);
if (featureSet != null)
{
 foreach (var feature in featureSet)
 {
&amp;nbsp; var propId = GisHelper.GetPropertyId(feature);
&amp;nbsp; var graphic = layer.Graphics.FirstOrDefault(
&amp;nbsp;&amp;nbsp; g =&amp;gt;&amp;nbsp; GisHelper.GetPropertyId(g) == propId
&amp;nbsp; );
&amp;nbsp; if (graphic == null)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; graphic = feature;
&amp;nbsp;&amp;nbsp; layer.Graphics.Add(graphic);
&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; graphic.Selected = true;
 }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:19:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509710#M2620</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-11T22:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509711#M2621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You got the idea &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I don't see anything wrong in your code.:confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess you checked that your GisHelper.GetPropertyId method was working well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check also that you included the PROP_ID field in the OutFields of your feature layer (in XAML).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry no others ideas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 05:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509711#M2621</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-03-07T05:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509712#M2622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You had mentioned using ObjectID, what did you mean by that exactly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem with my code, apparently, is that I'm adding a feature to the Graphics collection of my layer, but since my layer is OnDemand, whenever I zoom to the region that contains the feature that I added, it seems to be duplicating that feature on top of it, so the selected graphic is hidden.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I might be understanding it incorrectly too. This does seem to be happening only if I do this in the Initialized event handler of my layer... If I do this moments after the event has finished, this doesn't happen. I'm able to see my selected graphics.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 12:14:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509712#M2622</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2013-03-07T12:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Editor to select features, how to query for selections?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509713#M2623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You had mentioned using ObjectID, what did you mean by that exactly? &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I meant an unique identifier in order to avoid feature duplications.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ObjectId is a good candidate (the OnDemand mechanism uses it as well to avoid duplication).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Most generally the ObjectId field is called "OBJECTID" but to be more generic you can get the objectid field name from &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo~ObjectIdField.html"&gt;FeatureLayerInfo.ObjectIdField&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 14:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/using-editor-to-select-features-how-to-query-for/m-p/509713#M2623</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-03-07T14:18:04Z</dc:date>
    </item>
  </channel>
</rss>

