I am trying to show a particular kind of rendering to my geometry when a user clicks on the record of a feature data grid and zooms to the selection, but can't figure out what I am doing wrong...

Here is my code for the featureLayerFromMap.UpdateCompleted += new System.EventHandler(fslayer_UpdateCompleted);

void fslayer_UpdateCompleted(object sender, System.EventArgs e)
       ESRI.ArcGIS.Client.FeatureLayer featureLayerFromMap = (ESRI.ArcGIS.Client.FeatureLayer)(_mapService.Map.Layers["FeatureLayerControlLayer"]);            

        //*** Flashing of Polyline and Polygon when zoomed from a feature data grid record
        _objectIdDic = new Dictionary<string, string>();
        int count = 0;
        featureLayerFromMap.Graphics.ToList().ForEach(x => _objectIdDic.Add(x.Attributes["OBJECTID"].ToString(), count++.ToString()));

        if (featureLayerFromMap.Graphics.Count > 0)
            if (featureLayerFromMap.Graphics[0].Geometry.GetType() == typeof(ESRI.ArcGIS.Client.Geometry.Polygon))
                featureLayerFromMap.Renderer = this._mapLayout.Resources["PolygonGraphicLyrSelectedRenderer"] as IRenderer;
            else if (featureLayerFromMap.Graphics[0].Geometry.GetType() == typeof(ESRI.ArcGIS.Client.Geometry.Polyline))
                featureLayerFromMap.Renderer = this._mapLayout.Resources["PolylineGraphicLyrSelectedRenderer"] as IRenderer;

The feature layer is provided from a selection in a combo box... Can someone guide me on this?

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.