Setting field values of a list item in SharePoint is easy.  But when it comes to Multi-Choice fields, the code is a big different.  The following code shows how values can be added to a multi-choice field.

 

SPFieldMultiChoice choiceField = (SPFieldMultiChoice)myWeb.Fields["choiceFieldName"];

choiceField.Choices.Add("Value");

//Set PushChangesToLists to true if automatic update of List or Content types is required

choiceField.PushChangesToLists = false; 

choiceField.Upate();

by Niral on Mon, 19/05/2008 - 12:21pm   •   Sharepoint,

Comments

Hi Niral, thanks for your post. This works correctly, but I'm looking for a solution to this, http://stackoverflow.com/questions/6724227/how-to-push-site-columns-updates-to-content-types, any idea? I'm not finding a way to do it through modifying the field in the content type and I'm not finding the way to accomplish this through SPFieldLink. Thanks!