Using your results from the attribute query get the geometry from the result ESRI.ArcGIS.Client.Geometry.Geometry geo = e.FeatureSet.Features[0].Geometry from the QueryTask_ExecuteCompleted
// If initial query to populate states combobox if ((args.UserState as string) == "initial") { // Just show on initial load comboBox1.Items.Add("Select...");
foreach (Graphic graphic in args.FeatureSet.Features) { comboBox1.Items.Add(graphic.Attributes["Area_Code_"].ToString()); }
comboBox1.SelectedIndex = 0; return; }
// Remove the first entry if "Select..." if (comboBox1.Items[0].ToString().Contains("Select...")) comboBox1.Items.RemoveAt(0); // below code is for select Polygon // If an item has been selected GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; graphicsLayer.ClearGraphics();
FeatureSet featureSet = args.FeatureSet; if (featureSet != null && featureSet.Features.Count > 0) { // Show selected feature attributes in DataGrid Graphic selectedFeature = featureSet.Features[0];
// Hightlight selected feature selectedFeature.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol; graphicsLayer.Graphics.Add(selectedFeature);