private void GeoprocessorTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.GPExecuteCompleteEventArgs args) { btnPoint.IsEnabled = true; MessageBox.Show(args.Results.OutParameters.Count().ToString()); }
Solved! Go to Solution.
dg1.ItemsSource = gpLayer.FeatureSet.Features;
<sdk:DataGridTextColumn Binding="{Binding Path=Attributes[OID]}" Header="OID"/>
Results:
Messages:
�?� esriJobMessageTypeInformative: Executing (HailAnalysis): HailAnalysis "Feature Set" "100 Miles"
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:24 2012
�?� esriJobMessageTypeInformative: Executing (Buffer): Buffer "Feature Set" D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\Buffer.shp "100 Miles" FULL ROUND NONE #
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:24 2012
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:25 2012 (Elapsed Time: 1.00 seconds)
�?� esriJobMessageTypeInformative: Executing (Clip): Clip D:\agsResources\ArcSDE.sde\ArcSDE.A10ID.HailClaims D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\Buffer.shp D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip.shp #
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:25 2012
�?� esriJobMessageTypeInformative: Reading Features...
�?� esriJobMessageTypeInformative: Cracking Features...
�?� esriJobMessageTypeInformative: Assembling Features...
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:25 2012 (Elapsed Time: 0.00 seconds)
�?� esriJobMessageTypeInformative: Executing (Summary Statistics): Statistics D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip.shp D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip_Statistics.dbf "LossAmt MEAN;ExpAmt MEAN;LossAmt SUM;ExpAmt SUM" LossDt
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:25 2012
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:25 2012 (Elapsed Time: 0.00 seconds)
�?� esriJobMessageTypeInformative: Executing (Sort): Sort D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip_Statistics.dbf D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip_Statistics_S.dbf "FREQUENCY DESCENDING" UR
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:25 2012
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:25 2012 (Elapsed Time: 0.00 seconds)
�?� esriJobMessageTypeInformative: Executing (Table Select): TableSelect D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\HailClaims_Clip_Statistics_S.dbf D:\arcgisserver\arcgisjobs\gptools_gpserver\j1ef0965a68274e9e8f798b023f3ea66e\scratch\scratch.gdb\Ouput "OID >= 5"
�?� esriJobMessageTypeInformative: Start Time: Wed May 23 11:06:25 2012
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:26 2012 (Elapsed Time: 1.00 seconds)
�?� esriJobMessageTypeInformative: Succeeded at Wed May 23 11:06:26 2012 (Elapsed Time: 2.00 seconds)
GPFeatureRecordSetLayer gpLayer = e.Parameter as GPFeatureRecordSetLayer; foreach (Graphic graphic in gpLayer.FeatureSet.Features) { }
GraphicsLayer does not need to be part of map if there is no geometry.
private void Geoprocessor_JobCompleted(object sender, JobInfoEventArgs e) { Geoprocessor geoprocessorTask = sender as Geoprocessor; geoprocessorTask.GetResultDataCompleted += GeoprocessorTask_GetResultDataCompleted; geoprocessorTask.Failed += GeoprocessorTask_Failed; geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "output"); } private void GeoprocessorTask_GetResultDataCompleted(object sender, GPParameterEventArgs e) { GraphicsLayer graphicsLayer = MapApplication.Current.Map.Layers["MyResultGraphicsLayer"] as GraphicsLayer; GPFeatureRecordSetLayer gpLayer = e.Parameter as GPFeatureRecordSetLayer; MessageBox.Show(gpLayer.FeatureSet.Count().ToString()); foreach (Graphic graphic in gpLayer.FeatureSet.Features) { graphicsLayer.Graphics.Add(graphic); } MessageBox.Show(graphicsLayer.Count().ToString()); this.dg.GraphicsLayer = graphicsLayer; btnPoint.IsEnabled = true; } private void GeoprocessorTask_Failed(object sender, TaskFailedEventArgs e) { MessageBox.Show("Geoprocessing service failed: " + e.Error); btnPoint.IsEnabled = true; }