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();
Comments
Hi Niral, thanks for your
Permalink Submitted by Ariel (not verified) on Mon, 18/07/2011 - 11:07pm.