Select to view content in your preferred language

Alias from a graphics layer

473
2
06-22-2010 02:34 PM
BrianGustafson
Occasional Contributor
Is there a way to get the field alias to show up in a datagrid after a query and identify task.  I can get it to populate a combobox with the correct value but when I do that in a datagrid it  shows the real name in one column and the alias in the other.  I need the alias in one column and the value in the other.

Dictionary<string, string> flds = e.FeatureSet.FieldAliases;//give <name, alias>
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
One option is you to use the LINQ projection to create a new enumerable with the pair alias/value.

Something like:

using System.Linq;

......
    QueryDetailsDataGrid.ItemsSource = from keyValuePair in selectedFeature.Attributes
                                                          select new KeyValuePair<String, Object>(featureSet.FieldAliases[keyValuePair.Key], keyValuePair.Value);
0 Kudos
BrianGustafson
Occasional Contributor
That is what I needed.

Thanks,
0 Kudos