Reading values from SPFieldMultiChoice field

Reading values from a Multi Choice field sometimes gives lot of pains…it inserts “;#” between multiple values.

I will show you the following way to read values from the multi choice field which does not has this limitation

SPList list = web.Lists["{YourList}"]; 
SPListItem result = list.GetItemById(1);
SPFieldMultiChoice  choceField = result.Fields.GetField("MyMultiChoice") as SPFieldMultiChoice;
string multiChoiceValues= choceField.GetFieldValueAsText(result["MyMultiChoice"]);

Related Post

2 thoughts on “Reading values from SPFieldMultiChoice field”

  1. Hi Kyle,

    In the above code we first cast the choice field as SPFieldMultiChoice and then get the current value as text

    If you have any issues using the above code, you can let me know your issue and I will try my best to help.

Leave a Reply

Your email address will not be published. Required fields are marked *