I have an app that displays a results window with information about a feature using the identify tool...This is working fine.But I know what the create one more return window based off of another feature BUT this time simply show all the records (8 records, schools) in the results window...this is going to be a point layer and not identified on when the user clicks the map, but want to force the identify....I am using the identify example from ESRI API SIlverlight. This example shows how to return the results to a window from a user click. IF there are multiple returns then it populates a combobox with the results allowing the user to select and change the values on the window.I was wondering how to automate it to simply show all the records on a user click on the mapI am half way there because I can display the record I select...BUT I want the users click (which wont click on the feature) that identifys existing features....to force the identify on thsi other featureWould I use a buffer for this?Is there some way to automate it to simply select all?How do I loop through and display multiple records in the results window? I can see how this is being done for the combobox but cannot think of how to do this from VB adn loop it through the xaml file to show multiple results?Does that make any sense...PLEASE SEE ATTACHEMENTIf I can get this to work it will be eliminating the Combobox...so that is no worry...ThanksDEFINED GRID WITH FORMAT: <Grid Grid.Column="1" >
<StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="left" VerticalAlignment="top" >
<Grid x:Name="IdentifyGrid2" HorizontalAlignment="left" VerticalAlignment="Top" Margin="0,7,7,0" >
<Rectangle Stroke="Gray" RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
<Rectangle.Effect>
<DropShadowEffect/>
</Rectangle.Effect>
</Rectangle>
<TextBlock x:Name="DataDisplayTitleTop2" Text="Click on map to identify a feature" Foreground="Black" FontSize="10"
Margin="10,5,0,0" />
<TextBlock x:Name="DataDisplayTitleBottom2" Text="Click on map to identify a feature" Foreground="White" FontSize="10"
Margin="10,3,10,10" />
<StackPanel x:Name="IdentifyResultsPanel2" Height="180" Width="190" Orientation="Vertical" Margin="15" HorizontalAlignment="Center"
VerticalAlignment="Top" Visibility="Collapsed" >
<ComboBox x:Name="IdentifyComboBox2" MinWidth="150" SelectionChanged="cb_SelectionChanged2"
Margin="5,10,5,5" >
</ComboBox>
<Grid x:Name="IdentifyDetailsDataGrid2">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Foreground="White" Text="Day: " />
<TextBlock Foreground="White" Text="{Binding [Day]}" />
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
VB CODE:
Dim identifyParamsParcelsPrecinct As ESRI.ArcGIS.Client.Tasks.IdentifyParameters = New IdentifyParameters() With {.Geometry = clickPoint, .MapExtent = MyMap.Extent, .SpatialReference = MyMap.SpatialReference, .Width = CInt(Fix(MyMap.ActualWidth)), .Height = CInt(Fix(MyMap.ActualHeight)), .LayerOption = LayerOption.visible}
' Set the layer to identify on
identifyParamsParcelsPrecinct.LayerIds.Add(2)
Dim identifyTask2 As New IdentifyTask("http://gis.logis.org/arcgis/rest/services/MG_Test/MapServer")
AddHandler identifyTask2.ExecuteCompleted, AddressOf IdentifyTask2_ExecuteCompleted
AddHandler identifyTask2.Failed, AddressOf IdentifyTask2_Failed
identifyTask2.ExecuteAsync(identifyParamsParcelsPrecinct)
' SECOND BOX
Public Sub ShowFeatures2(ByVal results As List(Of IdentifyResult))
_dataItems2 = New List(Of DataItem2)()
If results IsNot Nothing AndAlso results.Count > 0 Then
IdentifyComboBox2.Items.Clear()
For Each result As IdentifyResult In results
Dim feature As Graphic = result.Feature
Dim title As String = result.Value.ToString() & " (" & result.LayerName & ")"
_dataItems2.Add(New DataItem2() With {.Title = title, .Data2 = feature.Attributes})
IdentifyComboBox2.Items.Add(title)
Next result
' Workaround for bug with ComboBox
IdentifyComboBox2.UpdateLayout()
IdentifyComboBox2.SelectedIndex = 0
End If
End Sub
Private Sub cb_SelectionChanged2(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
Dim index As Integer = IdentifyComboBox2.SelectedIndex
If index > -1 Then
IdentifyDetailsDataGrid2.DataContext = _dataItems2(index).Data2
End If
End Sub