3 out of 6 rated this helpful - Rate this topic

PeopleEditor Class

Windows SharePoint Services 3
Represents a PeopleEditor object in a PeoplePicker control.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
[ValidationPropertyAttribute("CommaSeparatedAccounts")] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
public class PeopleEditor : EntityEditorWithPicker
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Get e-mail address from PeopleEditor PickerEntity

To get the Email Address use

PickerEntity pckEntity = (PickerEntity)peResponsible.ResolvedEntities[0];
//where peResponsible is a PeopleEditor Control

string email = pckEntity.EntityData["Email"].ToString();


Hope it helps

(pckEntity.EntityData["Email"] only in Active Directory user stores. Joe J)

Using this control inside of an UpdatePanel issue

Using this control inside of an update panel and setting its visibility to off on first load, and then to on based on a postback event causes a javascript error. It also causes the control to no longer function.

Solution: Do not use Visible property. Instead use style="display: none" and on postback set to "display: block";

How to pull data from the PeopleEditor wp
Get e-mail address from PeopleEditor PickerEntity
I've got some bad news for you, sir.

'Microsoft.SharePoint.WebControls.PeopleEditor.PeopleInfo' is inaccessible due to its protection level.

...and, enumerating the key-value pairs in the EntityData hashtable:
DisplayName = WIN2K3\administrator
SPUserID = 1
PrincipalType = User


Any other ideas on how to recover the e-mail address from a PickerEntity?
Where to look for usage of PeopleEditor
best example is in _layouts/aclinv.aspx

- this page uses a PeopleEditor control called userPicker

to have a look at the codebehind:

-> open "Microsoft.SharePoint.ApplicationPages.dll" in Lutz Roeder's .NET Reflector
-> Go to "Microsoft.SharePoint.ApplicationPages.AclInv"
-> Check out "public void BtnOK_Click(object sender, EventArgs e);"
        this event adds users chosen in the PeopleEditor to a group or direclty grants them permissions.

What it does is:

-> Iterate through this.userPicker.ResolvedEntities, map to an array of SPUserInfo[];
-> Like so:
        PickerEntity entity2 = (PickerEntity) this.userPicker.ResolvedEntities[index];
        SPUserInfo info = new SPUserInfo();
        info.LoginName = entity2.Key;
        info.Email = (string) entity2.EntityData[PeopleEditor.PeopleInfo.Email];
        info.Name = entity2.DisplayText;
        info.Notes = string.Empty;
        addUsersInfo[index] = info;
-> then add that to a group like so:               this.ReferencedGroups.GetByID(int.Parse(this.DdlGroup.SelectedValue)).Users.AddCollection(addUsersInfo);