/* get the newly added choice field instance */
SPFieldChoice chFldGender = (SPFieldChoice)lst.Fields["Gender"];
/* set field format type i.e. radio / dropdown */
chFldGender.EditFormat = SPChoiceFormatType.Dropdown;
/* set the choice strings and update the field */
chFldGender.Choices.Add("Male");
chFldGender.Choices.Add("Female");
chFldGender.Update();
/* finally update list */
lst.Update();
No comments:
Post a Comment