Good Morning all
I have a set of checkboxes, each one contains a year as it's content beginning with 2005 and ending at 2013.
These years represent an attribute in a field from a REST service.
The field is "Year"
I would like the user to have the ability to check any number of these checkboxes and have a CLICK button that executes a query based on these selections.
i.e. If the user selects checkboxes, 2005, 2006, and 2009 the query will search the content of these checkboxes only.
Maybe adding what I have might help--
Partial Public Class MainPage
Inherits UserControl
Dim _year As String
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnExecute_Click(sender As Object, e As RoutedEventArgs)
For Each myCheckBox As CheckBox In stkPanel.Children.OfType(Of CheckBox)().Where(Function(myCheckBoxx) myCheckBoxx.IsChecked.Equals(True))
_year = myCheckBox.Content.ToString()
Next
Dim _QueryTask As New QueryTask("http://speedo:6080/arcgis/rest/services/ems/EMS_CALLS/MapServer/0")
AddHandler _QueryTask.ExecuteCompleted, AddressOf QueryTask_ExecuteCompleted
Dim _query As New ESRI.ArcGIS.Client.Tasks.Query()
_query.OutFields.Add("Year")
_query.Where = "Year = '" & _year & "'"
_query.ReturnGeometry = True
_QueryTask.ExecuteAsync(_query)
End Sub
Private Sub QueryTask_ExecuteCompleted(sender As Object, e As QueryEventArgs)
Dim _layer As GraphicsLayer = TryCast(myMap.Layers("myLayer"), GraphicsLayer)
_layer.Graphics.Clear()
Dim _featureSet As FeatureSet = e.FeatureSet
If _featureSet IsNot Nothing AndAlso _featureSet.Features.Count > 0 Then
For Each _featureGraphic As Graphic In e.FeatureSet.Features
_featureGraphic.Symbol = TryCast(LayoutRoot.Resources("red"), ESRI.ArcGIS.Client.Symbols.Symbol)
_layer.Graphics.Add(_featureGraphic)
Next _featureGraphic
End If
End Sub
End Class
Thank you - using Silverlight (XAML/VB)