I have a query that is being run....It finds the result and populates a list box. I set teh query withe WHERE clase to act as a wild card search....but now I need a place holder for the multiple returns....I am tryign this but not having any luck...Errors in the code:1. feature2.LayerName2. .Data = feature2.AttributesAny thoughts why I cant get the Combo box to populate with the results from the Query?Its obvious that I have some errors in my code but I can see them or figure out what to change...This was workign off the Identifty Example....but trying to convert it to run off of search query not a map click...Thanks in Advance...VB
Private _dataItems7 As List(Of DataItem7) = Nothing ' Parcels PID search
Private Sub ExecutePIDButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim queryTask As New QueryTask("http://gis./services/MG_Test_WGS84/MapServer/8")
AddHandler queryTask.ExecuteCompleted, AddressOf QueryTaskFindPID_ExecuteCompletedSearch
AddHandler queryTask.ExecuteCompleted, AddressOf QueryTask_ExecuteCompletedSpatialQuery
AddHandler queryTask.Failed, AddressOf QueryTaskFindPID_FailedSearch
Dim query As New ESRI.ArcGIS.Client.Tasks.Query()
query.OutFields.Add("*")
query.Where = String.Format("PID LIKE '%{0}%'", FindPID.Text.Trim())
query.ReturnGeometry = True
query.OutSpatialReference = MyMap.SpatialReference
queryTask.ExecuteAsync(query)
End Sub
Private Sub QueryTaskFindPID_ExecuteCompletedSearch(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)
Dim featureSet As FeatureSet = args.FeatureSet
' If an item has been selected
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayerSearch"), GraphicsLayer)
graphicsLayer.ClearGraphics()
If featureSet IsNot Nothing AndAlso featureSet.Features.Count > 0 Then
_dataItems7 = New List(Of DataItem7)()
For Each feature As Graphic In featureSet.Features
Dim feature2 As Graphic = featureSet.Features
Dim title As String = feature2.Attributes.ToString() & " (" & feature2.LayerName & ")"
_dataItems7.Add(New DataItem7() With {.Title = title, .Data = feature2.Attributes})
IdentifyComboBox.Items.Add(title)
Next feature
End If
' Workaround for bug with ComboBox
IdentifyComboBox.UpdateLayout()
IdentifyComboBox.SelectedIndex = 0
' SNIP
End Sub
Public Class DataItem7
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 privateData6 As IDictionary(Of String, Object)
Public Property Data6() As IDictionary(Of String, Object)
Get
Return privateData6
End Get
Set(ByVal value As IDictionary(Of String, Object))
privateData6 = value
End Set
End Property
End Class