Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (2)
Collapse All/Expand All Collapse All
This page is specific to
The 2007 product release

Other versions are also available for the following:
PeopleEditor Class (Microsoft.SharePoint.WebControls)
Represents a PeopleEditor object in a PeoplePicker control.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<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
    Inherits EntityEditorWithPicker
Visual Basic (Usage)
Dim instance As PeopleEditor
C#
[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.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Where to look for usage of PeopleEditor      Thomas Prentis ... RogerLin   |   Edit   |   Show History
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);


Tags What's this?: Add a tag
Flag as ContentBug
Get e-mail address from PeopleEditor PickerEntity      Joe Zamora   |   Edit   |   Show History
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?
Tags What's this?: Add a tag
Flag as ContentBug
How to pull data from the PeopleEditor wp      klinkby   |   Edit   |   Show History
Tags What's this?: Add a tag
Flag as ContentBug
Get e-mail address from PeopleEditor PickerEntity      Hernan123 ... Stanley Roark   |   Edit   |   Show History

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)

Tags What's this?: Add a tag
Flag as ContentBug
Using this control inside of an UpdatePanel issue      Keivan Sadralodabai ... FunctionVoid   |   Edit   |   Show History

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";

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker