Nishand's Blog

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

Updating UserProfile Property of type ChoiceList

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();

}

}

Published Sunday, May 20, 2007 9:45 PM by nishandv
Filed under: ,

Comments

No Comments
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker