I am using a custom property in custom visula w开发者_Go百科ebpart. 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
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
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;
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
精彩评论