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 want to Modify the Default People picker properties as Shown below. I want to hide the Highlighted Columns in the below image.

Does anybody know how can I do this using C#?

I can modify it or do I have to create new one?

People picker pop-up

share|improve this question
add comment

3 Answers 3

I use the folowing to create my custom dialog in C#:

Try to override constructor of PickerDialog class

For example:

public class CustomPickerDialog : PickerDialog
{
    public CustomPickerDialog()
        : base(new SimpleQueryControl(), new TableResultControl(), new CustomPeopleEditor())
    {
        ArrayList columnDisplayNames = ((TableResultControl)base.ResultControl).ColumnDisplayNames;
        columnDisplayNames.Clear();
        columnDisplayNames.Add("Name");
        columnDisplayNames.Add("LoginName");
        columnDisplayNames.Add("Email");
        ArrayList columnNames = ((TableResultControl)base.ResultControl).ColumnNames;
        columnNames.Clear();
        columnNames.Add("Name");
        columnNames.Add("LoginName");
        columnNames.Add("Email");
        ArrayList columnWidths = ((TableResultControl)base.ResultControl).ColumnWidths;
        columnWidths.Clear();
        columnWidths.Add("40%");
        columnWidths.Add("30%");
        columnWidths.Add("30%");
    }
}

Next override OnInit method in PickerEditor class:

public class CustomPeopleEditor: PeopleEditor
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        PickerDialogType = typeof(CustomPickerDialog);
    }
}

In this example there are u'll see only 3 fields in people dialog. By this way you can create custom people dialog. And don't forget to add your custom control to "safecontrols" in web.config of web application

share|improve this answer
add comment

Can you confirm that you can actually hide a column (like email/phone) from the People Picker search results using the setproperty stsadm command?

Because TechNet specifies that the set-property command is used for changing settings of the people picker control, and doesn't mention the hiding of specific fields.

You can remove the setting for a People Picker property by specifying the property name you want to clear, and using empty quotation marks for the property value.

To remove a property setting from People Picker, type the following command: stsadm.exe -o setproperty -pn-pv "" -url http://technet.microsoft.com/en-us/library/gg602066.aspx#section1

I've got two questions:

Does this set-property command actually works for removing fields from the people picker?

What are the property names for the values that you can remove?

If this solution works, this guy is wrong ;) SharePoint 2010 - Configure People Picker columns (add/remove)

Thanks in advance, Bastiaan

share|improve this answer
add comment

No idea about doing it with Object Model (C#) but you can remove the setting for a People Picker property by specifying the property name you want to clear, and using empty quotation marks for the property value.

To remove a property setting from People Picker, type the following command:

stsadm.exe -o setproperty -pn <Property Name> -pv "" -url <Web application URL>

For more information, see Peoplepicker-searchadforests: Stsadm property http://technet.microsoft.com/en-us/library/cc263460(office.12).aspx

Note: This is applicable to SharePoint 2010

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.