ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / Delete Method / Delete(MapMember,Int64) Method
A layer or standalone table.
The objectID of the feature or row to delete.

In This Topic
    Delete(MapMember,Int64) Method
    In This Topic
    Delete a feature or row.
    public void Delete( 
       MapMember mapMember,
       long oid
    Public Overloads Sub Delete( _
       ByVal mapMember As MapMember, _
       ByVal oid As Long _


    A layer or standalone table.
    The objectID of the feature or row to delete.
    Edit Operation Delete Features
    var deleteFeatures = new EditOperation();
    deleteFeatures.Name = "Delete Features";
    var table = MapView.Active.Map.StandaloneTables[0];
    //Delete a row in a standalone table
    deleteFeatures.Delete(table, oid);
    //Delete all the selected features in the active view
    //Select using a polygon (for example)
    //at 2.x - var selection = MapView.Active.SelectFeatures(polygon).Select(
    //      k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
    var selection = MapView.Active.SelectFeatures(polygon);
    //Execute to execute the operation
    //Must be called within QueuedTask.Run
    if (!deleteFeatures.IsEmpty)
      var result = deleteFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
    //or use async flavor
    //await deleteFeatures.ExecuteAsync();
    Delete all the selected features in FeatureSceneLayer
    //must support editing!
    //var featSceneLayer = .... ;
    if (!featSceneLayer.HasAssociatedFeatureService || 
    var delOp = new EditOperation()
      Name = "Delete selected features"
    //Assuming we have a selection on the layer...
    delOp.Delete(featSceneLayer, featSceneLayer.GetSelection().GetObjectIDs());
    await delOp.ExecuteAsync();//await if needed but not required

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also