EditOperation's callback is not executed for SDE dataset

920
3
07-04-2017 12:31 AM
MaxMax2
Occasional Contributor II

I have following code:

var operation = new EditOperation
{
    Name = "Test edit operation",
    ShowModalMessageAfterFailure = false,
    EditOperationType = EditOperationType.Long,
    CancelMessage = null,
    ProgressMessage = null,
    ShowProgressor = false
};

operation.Callback(context =>
{
    // I never get here if fc is a feature class from SDE database
},
fc);

operation.Execute();‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

If fc is a feature class from SDE database I never fall to callback's body. If feature class is from FGDB all is OK. What am I doing wrong?

I'm taking a feature class from Geodatabase returned by GDBProjectItem.GetDatastore.

Tags (2)
0 Kudos
3 Replies
JeffMatson
Occasional Contributor III

I'm assuming your SDE feature class is listed as "editable" in the List by Editing tab?  Are you hydrating the fc variable from a map layer or from a geodatabase object?

0 Kudos
MaxMax2
Occasional Contributor II

I've updated my question. I'm taking a feature class from Geodatabase returned by GDBProjectItem.GetDatastore. So this feature class is not added to map and I can't see it on List by Editing tab.

0 Kudos
JeffMatson
Occasional Contributor III

Sorry, I haven't messed with the Datastore object yet.  

This works for an SDE layer that isn't in the map:

Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(" [full path to connection file] ")));
var fc = geodatabase.OpenDataset<FeatureClass>(" [featureClass name] ") as FeatureClass;
0 Kudos