Select to view content in your preferred language

Add Polygon

1517
12
Jump to solution
01-06-2012 11:01 AM
JayKappy
Frequent Contributor
I am using this example to add a polygon: AND it works great
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave

I am referencing this example to open the data form to edit the data as soon as the feature is added...
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm

While this works for the Point it is not working for the line and polygon....which require mutliple mouse downs
Is there an event I can place on the Line adn Polygon Feature that when I add a new one i can open the data form
Is there an Editstarted or similar that will allow me to run soem code as soon as I finish creating the feature?

THanks

<esri:FeatureLayer ID="MG_Polygon" Visible="True" MouseLeftButtonUp="Poly_MouseLeftButtonUp"                 Url="http://156.555.555.189/ArcGIS/rest/services/TEST_FS/FeatureServer/24"          DisableClientCaching="True" Mode="OnDemand"         SelectionColor="#FFFFFF00" OutFields="*" />



    Private Sub Poly_MouseLeftButtonUp(ByVal sender As Object, ByVal args As GraphicMouseButtonEventArgs)         Dim featureLayer As FeatureLayer = TryCast(sender, FeatureLayer)          For Each g As Graphic In featureLayer.Graphics             If (g.Selected) Then                 g.UnSelect()             End If         Next          args.Graphic.Select()         MyPolygonFeatureDataForm.GraphicSource = args.Graphic          PolygonDataFormBorder.Visibility = Visibility.Visible     End Sub


Basically just trying to open the data form after the feature is added and allow the user t enter data....the way I hav it above you have to add the feature then click the new feature and then data form opens...for the line and polygon that is....adding a point it opens the data form....
?????
0 Kudos
12 Replies
JayKappy
Frequent Contributor
Christopher I hope you are still there....In post #7 you gave an example of changing the Geometry and the featuer layer....

I am trying this and getting errors on the 2nd line....'Geometry' is not a member of 'ESRI.ArcGIS.Client.Editor.Change'

                DataFormBorder.Visibility = Visibility.Visible
                FeatureDataForm.GraphicSource = change.Geometry
                FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer)
                FeatureDataForm.GraphicSource = change.Graphic
0 Kudos
JenniferNery
Esri Regular Contributor
DataFormBorder.Visibility = Visibility.Visible 
FeatureDataForm.GraphicSource = change.Geometry
FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer) 
FeatureDataForm.GraphicSource = change.Graphic

Kindly remove the highlighted line.
0 Kudos
ChristopherHill
Deactivated User
Christopher I hope you are still there....In post #7 you gave an example of changing the Geometry and the featuer layer....

I am trying this and getting errors on the 2nd line....'Geometry' is not a member of 'ESRI.ArcGIS.Client.Editor.Change'

                DataFormBorder.Visibility = Visibility.Visible
               FeatureDataForm.GraphicSource = change.Geometry
                FeatureDataForm.FeatureLayer = TryCast(change.Layer, FeatureLayer)
                FeatureDataForm.GraphicSource = change.Graphic


Sorry,

It was suppose to be change.Graphic I typed change.Geometry by mistake.
FeatureDataForm.GraphicSource = change.Graphic
0 Kudos