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 add a new column to a SharePoint list (the list is built on a content type) like this:

        SPField textfield = list.Fields.CreateNewField(SPFieldType.Text.ToString(), "new column");

        //the new field must be editable!
        SPField newField = list.Fields["new column"];
        newField.ShowInEditForm = true;
        newField.ShowInViewForms = true;
        newField.ShowInDisplayForm = true;
        newField.ShowInNewForm = true;

        //update the view
        SPView view = list.DefaultView;

The new column appears in the default view of the list and everything appears to work just fine. However, when I try to add a new item or edit an existing item, my new column doesn't appear in the form. A quick look in PowerShell reveals that "CanBeShowInEditForm" is set to true. What am I missing here?

share|improve this question
up vote 1 down vote accepted

Your missing adding the field as fieldlink to the Lists version for the content type

var ct = list.ContentTypes["NameOfCT"];
var fieldLink = new SPFieldLink(newField);

When you're using content types in a list only the fields corresponding to the content type is shown in forms. But all fields can be shown in views.

share|improve this answer

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.