I have created a custom list programatically. I want to add a field to it call User, this should be a lookup to the system Users. This will be like the default CreatedBy field.
How would I do this?
|
I have created a custom list programatically. I want to add a field to it call User, this should be a lookup to the system Users. This will be like the default CreatedBy field. How would I do this? |
||||
|
|
|
First connect to your list, then get the 'Fields' property which is of type SPFieldCollection, then call the 'Add' method. They key to answering your question is the SPFieldType enumerable. Check out this link to see what types of fields you can add
|
|||||
|