i have a field that i want to make not editable for the users. its a field of type text.
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 are iam doing wrong, why does this code hide the field in the forms? Iam not sure but is it possible to make a field "non editable" programmatically?