Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a problem in which I have to add an Auto Complete functionality for a new people picker of Sharepoint list newform.aspx

While Googling I found this

https://www.nothingbutsharepoint.com/sites/eusp/Pages/autocomplete-for-sharepoint-people-picker.aspx

Which is helpful but there are 2 main problems :

1.

  it will pick data from a custom list
  I want it to pick data from user profiles (directly from Sharepoint user profiles)

2.

  it doesn't work with out of the box people picker
  it works with a custom textbox though

Please help me out resolving these.

Thanks in advance!

share|improve this question

2 Answers 2

You could perhaps use the Javascript Client Object Model for this. Failing that you may need to use web services.

share|improve this answer

This is the very good article which is for MOSS 2007. But I am sure it will work for SP2010 and SP2013.

It shows how to create custom people picker inheriting OOTB people picker control. Hope it will help you.

http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/

You can use this PeopleEditor control when developing application pages or control templates using the following syntax:

<spuc:PeopleEditor ID="PeopleEditor1" runat="server" width="350px"
               AllowEmpty="true" MultiSelect="false" SelectionSet="User"  />

But only after you have added a directive at the top of the application page or control template:

<%@ Register TagPrefix="spuc" Namespace="Microsoft.SharePoint.WebControls"
         Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

If you are developing a web part you have to create the PeopleEditor control completely in code:

private PeopleEditor peopleEditor;
private void EnsureChildControls()
{
peopleEditor = new PeopleEditor();
peopleEditor.AutoPostBack = true;
peopleEditor.ID = "PeopleEditor1";
peopleEditor.AllowEmpty = false;
peopleEditor.MultiSelect = false;
Panel1.Controls.Add(peopleEditor);
}

This control is part of the Microsoft.SharePoint.dll and is located in the Microsoft.SharePoint.WebControls namespace.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.