Select to view content in your preferred language

Get ObjectId of added feature from ESRI.ArcGIS.Client.Tasks.EndEditEventArgs

1139
2
09-07-2011 02:05 PM
GüntherGrill
Occasional Contributor
After adding a graphic to a standalone table, I would like to know the Object Id of the previously added row. The ESRI.ArcGIS.Client.Tasks.EndEditEventArgs provides this information (see attached screenshot). How can I access this info from code?

I was hoping for something like :
e.Results.AddResults.item[0].ObjectId


Thanks for helping out,

Günther
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
Sure you can get the ID by index or by iterating through the results
private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e)
{
 if(e.Results.AddResults != null)
 {
  foreach (var result in e.Results.AddResults)
  {
   var oid = result.ObjectID;
  }
 }
}
0 Kudos
GüntherGrill
Occasional Contributor
Thanks Jeniffer, this work. My problem was that I subscribed to EventArgs, instead of EndEditEventArgs.

Thanks!,
günther
0 Kudos