string strAccountName = string.Empty;
for (int i = 0; i < userPicker.ResolvedEntities.Count; i++)
{
PickerEntity objEntity = (PickerEntity)userPicker.ResolvedEntities[i];
SPUserInfo objInfo = new SPUserInfo();
objInfo.LoginName = objEntity.Key;
strAccountName = objInfo.LoginName;
if (objEntity.EntityData["SPUserID"] != null)
{
// to return a sharepoint people group formatted string use...
strAccountName = objEntity.EntityData["SPUserID"].ToString() + ";#" + objEntity.DisplayText.ToString();
}
if (objEntity.EntityData["SPGroupID"] != null)
{
// to return a sharepoint people group formatted string use...
strAccountName = objEntity.EntityData["SPGroupID"].ToString() + ";#" + objEntity.DisplayText.ToString();
}
}
item["ColumnName"] = strAccountName;
for (int i = 0; i < userPicker.ResolvedEntities.Count; i++)
{
PickerEntity objEntity = (PickerEntity)userPicker.ResolvedEntities[i];
SPUserInfo objInfo = new SPUserInfo();
objInfo.LoginName = objEntity.Key;
strAccountName = objInfo.LoginName;
if (objEntity.EntityData["SPUserID"] != null)
{
// to return a sharepoint people group formatted string use...
strAccountName = objEntity.EntityData["SPUserID"].ToString() + ";#" + objEntity.DisplayText.ToString();
}
if (objEntity.EntityData["SPGroupID"] != null)
{
// to return a sharepoint people group formatted string use...
strAccountName = objEntity.EntityData["SPGroupID"].ToString() + ";#" + objEntity.DisplayText.ToString();
}
}
item["ColumnName"] = strAccountName;