Home
Manage Your Code
Snippet: Add Custom Field Type to SharePoint List (C#)
Title: Add Custom Field Type to SharePoint List Language: C#
Description: This example demonstrated how to programmatically add a custom field type to a SharePoint list. Views: 516
Author: Tony Bierman Date Added: 7/18/2008
Copy Code  
1if (!inventoryList.Fields.ContainsField("RegistrationFields"))
2{
3    SPField f = inventoryList.Fields.CreateNewField("ListColumnPicker", "RegistrationFields");
4    ListColumnPickerField lcpf = f as ListColumnPickerField;
5    lcpf.ListId = registrationsList.ID.ToString();
6    inventoryList.Fields.Add(lcpf as SPField);
7}