Search This Blog

Thursday, 20 December 2012

SharePoint People Picker Control

Hi All,

Let see few basic things about SharePoint People Picker Control <SharePoint:PeopleEditor>

Selection Set Property

Many times we require setting properties on people editor control for selection set.

Some wants to allow only users to be selected and others want group also to be selected.

Well, here are options that you can use as property with people editor control.

User- Only peoples

SPGroup – Groups of SharePoint site

DL – Distribution list

SecGroup – Security groups

If you want to allow user to select for example user as well as SPGroup, you can use comma between selection set. Examples are shown below.

User,SPGroup

User,SecGroup,DL

Clearing the People Picker Control

For clearing the People Picker Control we should first clear its Accounts and then entities then only it will clear. If you do it in the reverse way or miss any of one it wont work.

pplContUserName.Accounts.Clear();
pplContUserName.Entities.Clear();

where pplContUserName represents people picker object

References
http://www.sharepointkings.com/2010/01/understanding-people-picker-selection.html
http://jyothsnag.blogspot.com/2011/04/clearing-people-picker-control.html

No comments:

Post a Comment