Select to view content in your preferred language

Load Feature from FeatureLayer in ComboBox

775
3
08-29-2011 01:07 AM
ThomasDobrzinski1
Emerging Contributor
Hi,
does anyone know how to load Features (Points) from an ArcGisServer FeatureServer into a ComboBox and display the into the ComboBox?

FeatureLayer fl = myMap.Layers["MyLayer"] as FeatureLayer; ???
mycombo.itemSource = fl;
is it necessary to query the Layer or how does it work ?

Thanks for your help!
best regards !
0 Kudos
3 Replies
VincenzoPiscitelli
Emerging Contributor
Check out the Interactive Sample here for a Query Task.

QueryWithoutMap

The result is a FeatureSet

The Features property gives you an IList<of Graphics> which you can then bind to your comboBox.

Hope this helps.
0 Kudos
JenniferNery
Esri Regular Contributor
XAML-code:
<ComboBox ItemsSource="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].Graphics}"  VerticalAlignment="Top" HorizontalAlignment="Center">
 <ComboBox.ItemTemplate>
  <DataTemplate>
   <TextBlock Text="{Binding Attributes[Name]}"/>
  </DataTemplate>
 </ComboBox.ItemTemplate>
</ComboBox>
0 Kudos
ThomasDobrzinski1
Emerging Contributor
Thank you all for your help !
best regrads
0 Kudos