<ComboBox ItemsSource="{Binding ElementName=MyMap, Path=Layers[IncidentsLayer].LayerInfo.Fields}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox>
QueryFormCombo1.ItemsSource = "{Binding ElementName=MyMap, Path=Layers[MyLayer].LayerInfo.Fields}";
QueryFormCombo1.ItemsSource = (MyMap.Layers[LayerComboBoxItem] as FeatureLayer).LayerInfo.Fields;
queryPartOne = QueryFormCombo1.SelectedItem.ToString();
QueryComboBox.ItemsSource = (MapApplication.Current.SelectedLayer as FeatureLayer).LayerInfo.Fields;
Hi All,I am usingthe following code to try to populate a combo box as explaned in this thread. The combobox populates but all the entries are "ESRI.ArcGIS.Client.Field". I can not figure out how to populate the box with the field values. Any ideas..QueryComboBox.ItemsSource = (MapApplication.Current.SelectedLayer as FeatureLayer).LayerInfo.Fields;
What happens if you set the ComboBox's DisplayMemberPath to "Name"?
private void updateQueryCombo() { foreach (Field field in (MapApplication.Current.SelectedLayer as FeatureLayer).LayerInfo.Fields) { QueryComboBox.Items.Add(field.Name.ToString()); } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.