Select to view content in your preferred language

How to Set SDE-added Layers as Read-Only, Uneditable?

396
2
Jump to solution
02-22-2024 07:03 PM
MaxW
by
Emerging Contributor

I'm using the method new FeatureLayerCreationParams(new Uri(XXX)) to add layers from SDE to the map. How can I set the added layers as read-only and uneditable?

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi,

Here is a code snippet that sets a FeatureLayer to be uneditable.

 

QueuedTask.Run(() =>
{
  var cimFeatureLayer = layer.GetDefinition() as CIMFeatureLayer;
  var featureTable = cimFeatureLayer.FeatureTable;
  featureTable.Editable = false;
  cimFeatureLayer.FeatureTable = featureTable;
  layer.SetDefinition(cimFeatureLayer);

});

View solution in original post

2 Replies
UmaHarano
Esri Regular Contributor

Hi,

Here is a code snippet that sets a FeatureLayer to be uneditable.

 

QueuedTask.Run(() =>
{
  var cimFeatureLayer = layer.GetDefinition() as CIMFeatureLayer;
  var featureTable = cimFeatureLayer.FeatureTable;
  featureTable.Editable = false;
  cimFeatureLayer.FeatureTable = featureTable;
  layer.SetDefinition(cimFeatureLayer);

});
MaxW
by
Emerging Contributor

Thank you so much.

0 Kudos