Welcome to MSDN Blogs Sign in | Join | Help

MOSS 2007 : WSS 3.0 : How do you add items into Choice Site Column type.

Here is the sample code,

                SPWeb web = new SPSite("http://karthick64:4040/").OpenWeb();
                SPField spField = web.Fields["MyChoice"];
                SPFieldChoice choiceFields = (SPFieldChoice)spField;
                string[] choices = new string[3] {"x", "y", "z"};
                foreach (string choice in choices)
                {
                    choiceFields.Choices.Add(choice);
                }
                choiceFields.Update();

Keep Exploring... :)

Published Wednesday, January 10, 2007 7:24 PM by Karthikeyan
Filed under:

Comments

# MOSS 2007 : WSS 3.0 : How do you add items into Choice Site Column type.

Tuesday, May 22, 2007 11:54 PM by Aggregated Blogs

Here is the sample code, SPWeb web = new SPSite(" http://karthick64:4040/").OpenWeb (); SPField

Anonymous comments are disabled
 
Page view tracker