Welcome to my personal blog, All the information in this bogs is my ideas,findings and thoughts on .Net, Asp.Net and SharePoint.
ALL POSTING ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
What I found from my research is, before updating the “ChoiceList” set the “MaximumShown” property to a higher value (depends on how many items you are adding).
e.g.
using (SPSite site = new SPSite("http://servername"))
{
ServerContext context = ServerContext.GetContext(site); UserProfileManager m_mngr = new UserProfileManager(context); PropertyCollection props = m_mngr.Properties;
Property location = props.GetPropertyByName("CountryList"); Location.MaximumShown = Location.MaximumShown +1; property.ChoiceList.Add("India"); property.Commit();
}
}
Anonymous comments are disabled