CJ

The circle of life – ** .Net – Training – MOSS **

  • Past Post

  • Vistor Locations

Retreive SharePoint SPFieldChoice values

Posted by Clayton James on September 28, 2010

If you ever wanted to retrieve a collection of SPFieldChoice values then you can use the following code:

public static StringCollection GetEventCategoryChoices(SPWeb web)
  {
   SPList leaveList = web.Lists[LeaveCalendar.ListName];
   return ((SPFieldChoice)leaveList.Fields[Fields.EVENT_CATEGORY]).Choices;
  }

Advertisements

2 Responses to “Retreive SharePoint SPFieldChoice values”

  1. newest technologies…

    […]Retreive SharePoint SPFieldChoice values « CJ[…]…

  2. Best way add choice field data to the dropdownlist with required validation
    http://sharepointquicksolutions.blogspot.in/2012/11/spfieldchoice-to-dropdown-list.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: