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

What is a foolproof method of getting a list of fields that are editable by the user from the UI in a SharePoint list.

I tried getting the ShowInEditForm property, but in many cases, it returns NULL.

I tried this condition check,

listfield.Hidden != true && listfield.ReadOnlyField != true && listfield.FromBaseType != true

but that includes Attachment and Content Type Fields

share|improve this question

You can add this to your code

listfield.Type != SPFieldType.Attachments

Hope this helps

share|improve this answer

You could use the ShowInEditForm and the ShowInNewForm but check for the NULL. Is it is different than NULL, use this value. Else, try your condition check.

share|improve this answer

There is a more, um, DETAILED answer here, but it seems top-heavy to me:

I had this same problem today and found a more elegant answer, although Attachments seems to be a one-off fix. You also need to keep in mind that you can hide user-editable fields yourself, and they will appear as Hidden = true. For my case, I want to list all user-serviceable fields, including ones I had hidden from the user.

This method returns true if the field given is a user-editable field:

private bool IsValidField(SPField objField)
  return (!objField.ReadOnlyField &&
    objField.CanToggleHidden &&
    objField.Type != SPFieldType.Attachments);

OK, just let me say that the code block formatting feature in this forum kicks ass. I love it.

P.S. I realize this thread is almost a year old, so I presume the OP has found his answer or, as is usually the case, a work-around. I try to provide an answer to old threads when it relates to my current dilemna, as I figure someone else is going to search for the same problem as me, and it is better to have an answer in an old thread than none at all.

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.