SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

When looking at an SPField object, how can I tell if it supports multiple values?

I.e. a Choice field that is displayed using Checkboxes, a Managed Metadata field that allows multiple values, Person or Group that allows multiple selections, and quite possibly something I'm not thinking of?

The best I've come up with is compiling a list of multi valued types (e.g. TaxonomyFieldTypeMulti, LookupMulti, UserMulti..) and comparing against FieldTypeAsString. I'm wondering if there's a better approach.

share|improve this question
up vote 2 down vote accepted

Lookup fields (which user extends) supports AllowMultipleValues.

Then you can do:

var multi = field is SPFieldMultiChoice || 
    (field is SPFieldLookup && (field as SPFieldLookup).AllowMultipleValues);

Same for Taxonomy

share|improve this answer
I think this will work for me. I don't necessarily care about supporting arbitrary custom field types, but this would also work if they inherit from something sensible. To support multi choice columns as well: field is SPFieldMultiChoice || (field is SPFieldLookup && (field as SPFieldLookup).AllowMultipleValues) – lgaud Sep 17 '12 at 16:52
I updated the answer :) And yes you would have to implement all kind of checks if you want to 'cover it all' as far as I know :( – eirikb Sep 17 '12 at 16:58

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.