Right after my query is run I am trying this....I get the combobox to populate but I cannot get the records to show in the grid when I change the combobbox value....Is this approach way of???Thanks for your help...just trying to see if this angle will work...I think I am halfway there...just cant get the IdentifyDetailsDataGrid5 to populate with the selected ComboBox valueTryign to set the geomoetry to the results geometry...{.Geometry = result.GeometryThanks Private Sub QueryTaskFindPID_ExecuteCompletedSearch(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)
Dim featureSet As FeatureSet = args.FeatureSet
If featureSet IsNot Nothing AndAlso featureSet.Features.Count > 0 Then
For Each result As Graphic In featureSet
Dim identifyParamsParcels As ESRI.ArcGIS.Client.Tasks.IdentifyParameters = New IdentifyParameters() With {.Geometry = result.Geometry, .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
identifyParamsParcels.LayerIds.Add(8)
Dim identifyTask5 As New IdentifyTask("http://gis/services/MG_Test_WGS84/MapServer")
AddHandler identifyTask5.ExecuteCompleted, AddressOf IdentifyTask5_ExecuteCompleted
AddHandler identifyTask5.Failed, AddressOf IdentifyTask5_Failed
identifyTask5.ExecuteAsync(identifyParamsParcels)
_dataItems8 = New List(Of DataItem8)()
Next result
' SNIP SNIP
Private Sub IdentifyTask8_ExecuteCompleted(ByVal sender As Object, ByVal args As IdentifyEventArgs)
IdentifyDetailsDataGrid5.DataContext = Nothing
If args.IdentifyResults IsNot Nothing AndAlso args.IdentifyResults.Count > 0 Then
If IdentifyResultsPanel5.Visibility = Visibility.Collapsed Then
IdentifyResultsPanel5.Visibility = Visibility.Visible
IdentifyGrid5.Height = Double.NaN
IdentifyGrid5.UpdateLayout()
End If
ShowFeatures8(args.IdentifyResults)
Else
IdentifyComboBox5.Items.Clear()
IdentifyComboBox5.UpdateLayout()
If IdentifyResultsPanel5.Visibility = Visibility.Visible Then
IdentifyResultsPanel5.Visibility = Visibility.Collapsed
IdentifyGrid5.Height = Double.NaN
IdentifyGrid5.UpdateLayout()
End If
End If
End Sub
Public Sub ShowFeatures8(ByVal results As List(Of IdentifyResult))
_dataItems8 = New List(Of DataItem8)()
' Define the graphics layer to apply the graphic too
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MySelectionGraphicsLayerParcelMapClick"), GraphicsLayer)
graphicsLayer.ClearGraphics()
If results IsNot Nothing AndAlso results.Count > 0 Then
IdentifyComboBox5.Items.Clear()
For Each result As IdentifyResult In results
Dim feature As Graphic = result.Feature
' Add the selected Parcel as graphic
feature.Symbol = TryCast(LayoutRoot.Resources("ResultsFillSymbol"), ESRI.ArcGIS.Client.Symbols.Symbol)
graphicsLayer.Graphics.Add(feature)
Dim title As String = result.Value.ToString() & " (" & result.LayerName & ")"
_dataItems8.Add(New DataItem8() With {.Title = title, .Data8 = feature.Attributes})
IdentifyComboBox5.Items.Add(title)
feature.Symbol = TryCast(LayoutRoot.Resources("ResultsFillSymbol"), FillSymbol)
graphicsLayer.Graphics.Insert(0, feature)
Next result
' Workaround for bug with ComboBox
IdentifyComboBox5.UpdateLayout()
IdentifyComboBox5.SelectedIndex = 0
End If
End Sub Public Class DataItem8
Private privateTitle As String
Public Property Title() As String
Get
Return privateTitle
End Get
Set(ByVal value As String)
privateTitle = value
End Set
End Property
Private privateData8 As IDictionary(Of String, Object)
Public Property Data8() As IDictionary(Of String, Object)
Get
Return privateData8
End Get
Set(ByVal value As IDictionary(Of String, Object))
privateData8 = value
End Set
End Property
End Class
Private Sub cb_SelectionChanged8(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
Dim index As Integer = IdentifyComboBox5.SelectedIndex
If index > -1 Then
IdentifyDetailsDataGrid5.DataContext = _dataItems8(index).Data8
End If
End Sub