В веб-часть добавляем:
<SharePoint:PeopleEditor ID="PeopleEditor1" BorderStyle="Solid" BorderWidth="1" BorderColor="Black" runat="server" AllowEmpty="false" MultiSelect="true" SelectionSet="User" />
<SharePoint:PeopleEditor ID="PeopleEditor1" BorderStyle="Solid" BorderWidth="1" BorderColor="Black" runat="server" AllowEmpty="false" MultiSelect="true" SelectionSet="User" />
в code behinde пишем:
SPFieldUserValueCollection
fieldUserValueColl = new SPFieldUserValueCollection();int index = 0;
for (index = 0; index <= this.PeopleEditor1.ResolvedEntities.Count - 1; ++index)
{
PickerEntity pickerEntity = (PickerEntity)this.PeopleEditor1.ResolvedEntities[index];
fieldUserValueColl.Add(
new SPFieldUserValue(web, Convert.ToInt32(pickerEntity.EntityData["SPUserID"]), pickerEntity.Key));
}
Propertis.ListItem["Соавторы"] = fieldUserValueColl;
Propertis.ListItem.Update();
Комментариев нет:
Отправить комментарий