Microsoft.SharePoint.WebCon ...


PeopleEditor Class (Microsoft.SharePoint.WebControls)
Represents a PeopleEditor object in a PeoplePicker control.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

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
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
     System.Web.UI.WebControls.WebControl
       Microsoft.SharePoint.WebControls.EntityEditor
         Microsoft.SharePoint.WebControls.EntityEditorWithPicker
          Microsoft.SharePoint.WebControls.PeopleEditor
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Tags :


Community Content

RogerLin
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);


Tags :

Joe Zamora
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?
Tags :

klinkby
How to pull data from the PeopleEditor wp
See http://www.codeproject.com/KB/sharepoint/PeopleEditorControl.aspx
Tags :

Stanley Roark
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)

Tags :

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

Tags :

Page view tracker