Select to view content in your preferred language

How to bing back the fields from a layer into a combobox

446
2
02-06-2014 05:00 AM
Abdoulaye_Djibril_MademouDIALL
New Contributor
Hello Every One ,
i am working with arcgis APi for silverlight and i have some difficult,

i Have two(2) combobox comboboxlayer and comboboxfields
i would like bring back all the fields of the selected layers  in comboboxlayers
is there someone who knows how to do that ?

Thanks for any Help
0 Kudos
2 Replies
brettangel
Occasional Contributor II
Something like this should work. 

public List<string> fields = new List<string>();
foreach (var element in ((FeatureLayer)MapApplication.Current.SelectedLayer).LayerInfo.Fields)
{
   fields.Add(element.FieldName.ToString());
}
Listbox.ItemsSource = fields;
0 Kudos
Abdoulaye_Djibril_MademouDIALL
New Contributor
Thanks for the reply
but it does not work for me
I want to know what The variable ''MapApplication'' represent in the contexte (Namespace or the name of my Map)
thanks again
0 Kudos