I have a field that I want to make not editable for the users. It's a field of type
I have tried this code, but it hides the field in forms view:
SPList list = web.lists["caseslist"]; SPField field = list.Fields.GetField("casenumbers"); field.ReadOnlyField = true; field.ShowInDisplayForm = true; field.ShowInEditForm = true; field.ShowInNewForm = true; field.Update();
What am I doing wrong, why does this code hide the field in the forms?
I am not sure but is it possible to make a field "non editable" programmatically?