ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / BasicFeatureLayer Class / SetEditable Method
A boolean to toggle editability.
Example

In This Topic
    SetEditable Method (BasicFeatureLayer)
    In This Topic
    Enables or disables editing on a basic feature layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub SetEditable( _
       ByVal isEditable As Boolean _
    ) 
    public void SetEditable( 
       bool isEditable
    )

    Parameters

    isEditable
    A boolean to toggle editability.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Just setting it true will not make a basic feature layer editable unless you have permission to edit on data source level.
    Example
    Change layer visibility, editability, snappability
    {
        if (!layer.IsVisible)
            layer.SetVisibility(true);
    
        if (layer is FeatureLayer featureLayerToChange)
        {
            if (!featureLayer.IsEditable)
                featureLayer.SetEditable(true);
    
            if (!featureLayer.IsSnappable)
                featureLayer.SetSnappable(true);
        }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also