Looking for a snippet of code.
A:
The "People picker" control is used by SP when a column is of type User
so, the following snippet will add one such column:
using (SPWeb oWebsite = SPContext.Current.Site.AllWebs["MySite"])
{
SPFieldCollection collFields = oWebsite.Lists["MyList"].Fields;
collFields.Add("MyField", Microsoft.SharePoint.SPFieldType.User, false);
}
Timores
2010-10-06 14:03:29
Thanks. I kept missing the SPFieldTYpe.User. Duh.
Shane
2010-10-06 14:18:05