Select to view content in your preferred language

how to use featurelayer.undoedit

845
4
09-01-2011 12:06 AM
kaustavroy
Deactivated User
Dear friends
I am new to silverlight.I have a parcel layer on delete of a feature i want to delete ownership from a non sde oracle table through a wcf method . i want to rollback the feature delete if the ownership record delete fails .pls suggest me the workflow for this .And please send the code to implement  featurelayer.undoedit

thanks in advance
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor
use myFeatureLayer.UndoEdits() to undo all uncommitted edits, or myFeatureLayer.UndoEdits(graphic) to undo edits for the specific graphic.
0 Kudos
kaustavroy
Deactivated User
Thanks for the reply.I had tried the same but it dint roll back.I have pasted sample code undoedit is not happening

Private pfeatureLayer As FeatureLayer

  Public Sub New()
        InitializeComponent()
        MyDrawObject = New Draw(MyMap) With {.LineSymbol = TryCast(LayoutRoot.Resources("DrawLineSymbol"), LineSymbol), .FillSymbol = TryCast(LayoutRoot.Resources("DrawFillSymbol"), FillSymbol)}

        AddHandler MyDrawObject.DrawComplete, AddressOf MyDrawObject_DrawComplete

        pfeatureLayer = MyMap.Layers(1)
    End Sub

  Sub insertdata(ByVal pgeo As Geometry)
    
        AddHandler pFtrLayer.EndSaveEdits, AddressOf saveeditsfinished
        AddHandler pFtrLayer.SaveEditsFailed, AddressOf saveeditsfailed
        Dim x As New ESRI.ArcGIS.Client.Graphic
        x.Geometry = pgeo
        x.Attributes("CID") = 123456
        pFtrLayer.Graphics.Add(x)
        pFtrLayer.SaveEdits()
    End Sub

  Private Sub saveeditsfinished(ByVal sender As Object, ByVal e As EndEditEventArgs)
    
        pfeatureLayer.UndoEdits()
    End Sub
0 Kudos
MuralidharMoka
Emerging Contributor
We were looking for an option to do Undo Edits on a feature layer.
This thread said there is an Undo Edit options, but I did not find it on the intellisense.
Is the option still there in the 2.2 version. Let us know. This is important for us.

Thanks for the help
Muralidhar Moka
0 Kudos
JenniferNery
Esri Regular Contributor
Yes, FeatureLayer.UndoEdits() is supported in v2.2 http://help.arcgis.com/en/webapi/silverlight/2.2/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Featur.... Note, however that in order to have a chance to undo edits, FeatureLayer.AutoSave must be False. Otherwise, all edits (geometry or attribute) will be committed and saved to the server immediately.
0 Kudos