0
votes

I am using a custom property in custom visula webpart. This property is used to select users from AD. for this I want to provide people picker control. Can anyone tell me how to bind this people picker control for custom webpart property.

Note: I am using visual studio 2010 and working with sharepoint 2010

3

3 Answers

3
votes

Refer the Using People Picker control for knowing how to bind the people picker for custom webpart property. Then for a webpart custome property pane refer to this link

2
votes

set the property of people editor like below:-

//Declaring PeopleEditor object
PeopleEditor ctrlpplPicker = new PeopleEditor ();
//Defining properties of the PeopleEditor
ctrlpplPicker.AutoPostBack = false;
ctrlpplPicker.PlaceButtonsUnderEntityEditor = true;
ctrlpplPicker.ID = "pplEditor";
ctrlpplPicker.AllowEmpty = false;
ctrlpplPicker.SelectionSet = "User, DL, SecGroup, SPGroup";
ctrlpplPicker.MultiSelect = true;
ctrlpplPicker.MaximumEntities = 5;
0
votes

If you want to display this control in your web part property pane, you need to write a custom editor part:

http://msdn.microsoft.com/en-us/library/hh228018.aspx