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

When searching through the people picker, results are sorted by their account name and not by their display name.

Is there any way to change this behavior?

share|improve this question

migrated from serverfault.com Jan 4 '12 at 3:12

This question came from our site for professional system and network administrators.

add comment

1 Answer 1

PeopleQueryControl using SPUtility.SortPrincipalInfo() method:

private static IList SortPrincipalInfo(IEnumerable principals)
{
    SortedList list = new SortedList();
    foreach (SPPrincipalInfo info in principals)
    {
        string str = info.LoginName.ToLowerInvariant();
        string key = string.Concat(new object[] { info.DisplayName, " ", str, info.IsSharePointGroup });
        if (!list.ContainsKey(key))
        {
            list.Add(key, info);
        }
    }
    return list.Values;
}

PeoplePicker sorts results by display name. Can you give more information (providers you are using and other)

share|improve this answer
add comment

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.