Wednesday 27 November 2013

Programmatically get people picker value from sharepoint list using C#

Share it Please

                   
string users = string.Empty;
SPFieldUserValueCollection userCol = new SPFieldUserValueCollection(SPContext.Current.Web, listItem["SiteOwner"].ToString());
foreach (SPFieldUserValue usrItm in userCol)
  {
  users += usrItm.User.ToString() + ",";
  }
   this.spPeoplePicker.CommaSeparatedAccounts = users.Remove(users.LastIndexOf(","), 1);

No comments:

Post a Comment

Followers

Follow The Author