<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()); } }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.