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?

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

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


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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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