Select to view content in your preferred language

identify sample

769
2
04-30-2010 08:57 AM
CraigPerreault
Deactivated User
I do not get any data in my DataGrid using this code from the Identify sample in the ArcGIS API for Silverlight Interactive Samples.
Any ideas???
----------------------------------------------------------- c#  ---------------------------------------------------------------
                        <slData: DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None"
                              Background="White">
                            <slData: DataGrid.Columns>
                                <slData: DataGridTextColumn Width="95" Binding="{Binding Path=Key}" FontWeight="Bold"/>
                                <slData: DataGridTextColumn Width="115" Binding="{Binding Path=Value}"/>
                            </slData: DataGrid.Columns>
                        </slData: DataGrid>

----------------------------------------------------------- xaml  ---------------------------------------------------------------
                foreach (IdentifyResult result in results)
                {
                    Graphic feature = result.Feature;
                    string title = result.Value.ToString() + " (" + result.LayerName + ")";
                    _dataItems.Add(new DataItem()
                    {
                        Title = title,
                        Data = feature.Attributes
                    });
                    IdentifyComboBox.Items.Add(title);
                }
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Might be a bad initialization of the ItemsSource.

When the selection changes in the combo box, is the ItemsSource well initialized ? (IdentifyDetailsDataGrid.ItemsSource = _dataItems[index].Data; )

/Dominique
0 Kudos
CraigPerreault
Deactivated User
That was the problem, Thanks Dominique.
0 Kudos