0

I would like to know how to use the custom SPFieldType (Existing on the Site) when adding new SPList column.

E.g. [Normal way using the SPFieldType.Text field type]

list.Fields.Add("Location", SPFieldType.Text, true);
list.Update();

How about for the custom field type?

list.Fields.Add("Location", [Custom SPField Type], true); ?

Thanks in advance.

fEi
  • 3
  • 2

1 Answers1

2

Instead of Add, try AddFieldAsXml.

For more information, see Programmatically creating a field (column) from the Custom field type.

Rich Bennema
  • 10,295
  • 4
  • 37
  • 58