<?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: Only display features from layer filter in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490458#M12578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you can use VisualStateManager to update the symbol to null or transparent color when unselected. You can look at this sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Mar 2011 17:19:10 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2011-03-25T17:19:10Z</dc:date>
    <item>
      <title>Only display features from layer filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490457#M12577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible with the current API to display only the selected feature from selected layer? I would like to have a combobox with state names (from my current State layer). Upon selection of that state I would like the filter the State Layer for the user selection and display only that feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 15:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490457#M12577</guid>
      <dc:creator>RobertMueller</dc:creator>
      <dc:date>2011-03-25T15:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Only display features from layer filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490458#M12578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you can use VisualStateManager to update the symbol to null or transparent color when unselected. You can look at this sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 17:19:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490458#M12578</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-03-25T17:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Only display features from layer filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490459#M12579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wasn't going that direction, but I think that will work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My other question is the one I thought was going to be easy for me to figure out. I've created combobox queries similar to the County Query Sample, but I can't seem to to populate the layer names in this combobox. The list box code for this function is simply;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;ListBox x:Name="MyList" ItemsSource="{Binding ElementName=Map, Path=Layers}"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But how do you convert it to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ComboBox x:Name="CountyQueryComboBox" Grid.Row="1" MinWidth="150" SelectionChanged="CountyQueryComboBox_SelectionChanged" Margin="5,1,5,5" &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More so, how do I change the "County Query Sample" code behind to work with this task?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 17:56:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490459#M12579</guid>
      <dc:creator>RobertMueller</dc:creator>
      <dc:date>2011-03-25T17:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Only display features from layer filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490460#M12580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was hoping there's a way to create the query in XAML alone but it seems like &amp;amp;apos; for single quote (') is not supported in XAML. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try out the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 &amp;lt;Grid x:Name="LayoutRoot" Background="White"&amp;gt;
&amp;nbsp; &amp;lt;esri:Map x:Name="MyMap"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Map.Extent&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Envelope XMin="-178.217598362366" YMin="18.921786345087" XMax="-66.9692709841984" YMax="71.4062353672549"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Envelope.SpatialReference&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SpatialReference WKID="4269"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Envelope.SpatialReference&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Envelope&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Map.Extent&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer ID="MyStateLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5" OutFields="*"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureLayer ID="MyCountyLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3" OutFields="*" /&amp;gt;
&amp;nbsp; &amp;lt;/esri:Map&amp;gt;
&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center"&amp;gt;
&amp;nbsp; &amp;lt;ComboBox x:Name="MyStates" ItemsSource="{Binding ElementName=MyMap, Path=Layers[MyStateLayer].Graphics}" SelectionChanged="ComboBox_SelectionChanged"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;ComboBox.ItemTemplate&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataTemplate&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding Attributes[STATE_NAME]}"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataTemplate&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/ComboBox.ItemTemplate&amp;gt;
&amp;nbsp; &amp;lt;/ComboBox&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;ComboBox x:Name="MyCounties" ItemsSource="{Binding ElementName=MyMap, Path=Layers[MyCountyLayer].Graphics}"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;ComboBox.ItemTemplate&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataTemplate&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding Attributes[CNTY_FIPS]}"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataTemplate&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/ComboBox.ItemTemplate&amp;gt;
&amp;nbsp; &amp;lt;/ComboBox&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding ElementName=MyStates, Path=SelectedItem.Attributes[STATE_NAME], StringFormat='STATE_NAME = &amp;amp;quot;\{0\}&amp;amp;quot;'}"/&amp;gt;
&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
 &amp;lt;/Grid&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
 var stateName = ((sender as ComboBox).SelectedItem as Graphic).Attributes["STATE_NAME"] as string;
 FeatureLayer countyLayer = this.MyMap.Layers["MyCountyLayer"] as FeatureLayer;
 countyLayer.Where = string.Format("STATE_NAME = '{0}'", stateName);
 countyLayer.Update();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's more than one way to populate your combo box with county based on state selection. The code above is just one sample. You can also use QueryTask and store results in a GraphicsLayer and still bind to the Attributes the same way as I did when working with the FeatureLayers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/only-display-features-from-layer-filter/m-p/490460#M12580</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T21:35:22Z</dc:date>
    </item>
  </channel>
</rss>

