in aspx page:
<SharePoint:PeopleEditor ID="peAssignedTo" Width="350px" runat="server" PlaceButtonsUnderEntityEditor="false"
AllowTypeIn="True" MultiSelect="true" EnableBrowse="True" AllowEmpty="false" />
in code behind:
ArrayList _arrayList = new ArrayList();
//null checking
if (!string.IsNullOrEmpty(Convert.ToString(nitem["people and group fld name"])))
{
SPFieldUserValueCollection users = nitem["people and group fld name"] as SPFieldUserValueCollection;
if (users != null)
{
foreach (SPFieldUserValue user in users)
{
PickerEntity _pickerEntity = new PickerEntity();
_pickerEntity.Key = user.User.LoginName;
_pickerEntity.IsResolved = true;
_arrayList.Add(_pickerEntity);
}
"idof people editor control".UpdateEntities(_arrayList);
}
}
<SharePoint:PeopleEditor ID="peAssignedTo" Width="350px" runat="server" PlaceButtonsUnderEntityEditor="false"
AllowTypeIn="True" MultiSelect="true" EnableBrowse="True" AllowEmpty="false" />
in code behind:
ArrayList _arrayList = new ArrayList();
//null checking
if (!string.IsNullOrEmpty(Convert.ToString(nitem["people and group fld name"])))
{
SPFieldUserValueCollection users = nitem["people and group fld name"] as SPFieldUserValueCollection;
if (users != null)
{
foreach (SPFieldUserValue user in users)
{
PickerEntity _pickerEntity = new PickerEntity();
_pickerEntity.Key = user.User.LoginName;
_pickerEntity.IsResolved = true;
_arrayList.Add(_pickerEntity);
}
"idof people editor control".UpdateEntities(_arrayList);
}
}
No comments:
Post a Comment