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 added a check Check Box to a custom list library form which works well with new files uploaded and I can check the property Value by


but how can I check Property exists or not(for list items that are already there before I added this checkbox column) as otherwise I will get a exception.

share|improve this question
up vote 3 down vote accepted

Check if listItem.Properties["columnName"] is null

And you don't have to go through a string if not just use (bool)listItem.Properties["columnName"]

So a full test could be:

if (listItem.Properties["columnName"] != null
 && (bool)listItem.Properties["columnName"])
    // Checked
    // Not Checked
share|improve this answer

This has worked for me in the past:

if(listItem.Properties["columnName"] != null)
share|improve this answer

If you already have an instance of either the parent List of ListItem you could easily check whether the particular field does exist (e.g. if you use multiple content types you could try directly on the content type), by using one method of the Fields property of type SPFieldCollection - see here for more details

Then you could check its value for null, etc.

Recomandation: Try using always the InternalName as DisplayName could be changed at any time (both Content Type fields or regular Columns added directly to the list).

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.