Select to view content in your preferred language

How to update Acreage field after edit the polygon's geometry?

718
2
03-15-2011 11:06 AM
weiliang
Deactivated User
Hi,

I have an Acres filed for a polygon feature class. After I edit its vertices (which changes its geometry), I want the Acres field value could dynamically been updated. How can I reference the polygon in the code which is been selected to change the vertics?

I have similar problem of changing long/lat fields dynamically for the point data.

BTW, I know that I should use geometry service to calculate the area.

Thanks for your help in advance.

Wei
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
Are you using Editor.EditVertices? If so, you can subscribe to Editor.EditCompleted event.

private void Editor_EditCompleted(object sender,Editor.EditEventArgs e)
{
 if (e.Action == Editor.EditAction.EditVertices)
 {
  foreach(var edit in e.Edits)
   //TODO: use this edit.Graphic
 }
}


If you are performing the geometry edit yourself, I imagine you are using some layer mouse events to get to select a graphic for editing.
private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
{
 //TODO use e.Graphic
}
0 Kudos
weiliang
Deactivated User
Many thanks for your reply, Jennifer.

Have a great evening!

Wei
0 Kudos