SharePoint: programmatically retrieve values โ€‹โ€‹from a MultiChoice field

I copy multiple field values โ€‹โ€‹from one list item to another. If I just call ToString() in the MultiChoice field, I get a value similar to ;#Value;# , which is obviously not the value I want to copy. The target element is Text , so I just want to copy the values โ€‹โ€‹into an array, join the "," to get a good text representation.

How to get the "real" value (s) from a field? Field Class Type SPFieldMultiChoice

+4
source share
1 answer

There is an SPFieldMultiChoiceValue class. Initialize it using the field value and you will have a collection of the specific option selected. Then you convert this collection to a string that you like. http://msdn.microsoft.com/en-us/library/ms415672.aspx

+4
source

Source: https://habr.com/ru/post/1332332/


All Articles