ArcGIS Pro 3.3 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 void SetEditable( 
       bool isEditable
    )
    Public Sub SetEditable( _
       ByVal isEditable As Boolean _
    ) 

    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 featureLayer)
    {
      if (!featureLayer.IsEditable)
        featureLayer.SetEditable(true);
    
      if (!featureLayer.IsSnappable)
        featureLayer.SetSnappable(true);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also