I have created add-in toolbar with C# arcobjects. I am creating some empty geodatabase shapefiles. While creating featureclass i want to assign some default value to attribute and then make it read-only so user can not modify that value later.
IField field = new ESRI.ArcGIS.Geodatabase.FieldClass();
IFieldEdit fieldEdit= (ESRI.ArcGIS.Geodatabase.IFieldEdit)field ;
fieldEdit.Name_2 = "something"
fieldEdit.Type_2 = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString;
fieldEdit.Length_2 = 10;
fieldEdit.DefaultValue_2 = "yes";
when i set fieldEdit.Editable_2 = false
, then in attribute table, i see default value null instead of "yes", field is non editable.
I want field value as yes and non editable. Any suggestions?