A quick post:
Lets say that you do not want to allow users to possibility to edit and insert values to a custom field in one of your lists. To do this you can set the values of one of the following properties of a SPField object:
ShowInEditForm
ShowInDisplayForm
ShowInNewForm
You can do this programmatically at any time, below is a link on how to do it:
Or by XML definition:
<Field Type=”Number” ShowInEditForm=”FALSE” ShowInNewForm=”FALSE” DisplayName=”Counter” Required=”FALSE” EnforceUniqueValues=”FALSE” Indexed=”FALSE” Group=”My Group” ID=”{7f111eff-569d-4852 8bf2-ba0fcee6c69a}” SourceID=”{b1498d8e-4ad9-4d0d-8584-53d9a5de8c11}” StaticName=”Counter” Name=”Counter”>
<Default>0</Default>
</Field>
Links to MSDN about the properties:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.showineditform.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.showindisplayform.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.showinnewform.aspx
