Hi all:
I'm having trouble hiding a SPField from the user view programmatically.
I tried the obvious way of:
SPField newField = web.Site.RotWeb.Fields.GetField("order");
string newField = list.Fields.Add(newField);
list.Fields["order"].Hidden = true; // <--- exception: read-only field
list.Update();
The exception says the field is read only so I can't modify it.
This field is added in the code and hence it'll be unghosted from the field collection. Besides from the UI, how can I make the field hidden?
Thanks.