ArcGIS Pro 2.9 API Reference Guide
Inspector Class
Members  Example 

ArcGIS.Desktop.Editing.Attributes Namespace : Inspector Class
Provides access to the attribute values on features and rows.
Syntax
Remarks

This class is primarily used to get or set the attribute values on features or rows. Additionally it provides some meta information.
To get or set attribute values, first load a feature or row into the class then use the class properties or attribute index/name.

You can also use the Inspector class to obtain schema information about a mapMember. Use the LoadSchema(MapMember) or LoadSchemaAsync(MapMember) methods to obtain schema information.

Example
QueuedTask.Run(() =>
{
  var insp = new Inspector();
  insp.Load(featLayer, oid);

  //get the shape of the feature
  var myGeometry = insp.Shape;

  //get an attribute value by name
  var propValue = insp["Prop_value"];

  //set an attribute value by name
  insp["Parcel_no"] = 42;

  //perform the edit
  var op = new EditOperation();
  op.Name = "Update parcel";
  op.Modify(insp);
  op.Execute();
});
var insp = new Inspector();
insp.LoadSchema(featLayer);
var attrib = insp.Where(a => a.FieldName == "Mineral").First();

attrib.AddValidate(() =>
{
  if (attrib.CurrentValue.ToString() == "Salt")
    return Enumerable.Empty<ArcGIS.Desktop.Editing.Attributes.Attribute.ValidationError>();
  else return new[] { ArcGIS.Desktop.Editing.Attributes.Attribute.ValidationError.Create("Error", ArcGIS.Desktop.Editing.Attributes.Severity.Low) };
});
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
      ArcGIS.Desktop.Editing.Attributes.Inspector

Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

Inspector Members
ArcGIS.Desktop.Editing.Attributes Namespace