HOW TO
Instructions provided explain how to update a datagrid dynamically with the query results, without hard-coding attribute names, similar to the Attribute Query Sample.
Code:
QueryDetailsDataGrid.ItemsSource = selectedFeature.Attributes;
Code:
var dictionary1 = selectedFeature.Attributes as IDictionary;
foreach (DictionaryEntry pair in dictionary1)
{
var str = "Attributes[" + pair.Key.ToString() + "]";
QueryDetailsDataGrid.Columns.Add(new DataGridTextColumn
{
Header = pair.Key,
Binding = new Binding(str)
});
}
Code:
<slData:DataGrid x:Name="QueryDetailsDataGrid" AutoGenerateColumns="True" Background="White"/>
Get help from ArcGIS experts
Download the Esri Support App