SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to change an SPField after SPList creation, but I'm not getting any results of that change. using this code:

    SPField oSPField = oSPList.Fields[new Guid("MyFieldGuid")];
    oSPField.ReadOnlyField = true;
    oSPField.ShowInEditForm = false;
    oSPField.ShowInNewForm = false;

and then...nothing happens. What's wrong?is there any change to change it without coding?

(the field CT is provided by an ContentType Hub.)

share|improve this question
up vote 1 down vote accepted

Since you are effectively changing the list schema, you may have to do an oSPList.Update() as well.

share|improve this answer
even with that update, still not working... – fallout Apr 4 '12 at 16:25
Does your site have Output Caching enabled? – Dave Wise Apr 4 '12 at 16:27
no, it's unchecked... – fallout Apr 4 '12 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.