You are hereBlogs / Niral's blog / Add choices to Sharepoint Multi-Choice Field
Add choices to Sharepoint Multi-Choice Field
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 requiredchoiceField.PushChangesToLists = false; choiceField.Upate();
- 522 reads
Tags
Post new comment