Quantcast
Channel: Contenty Types – For the love of challenges :)
Viewing all articles
Browse latest Browse all 5

Hiding Custom SharePoint fields from edit mode, new window or display mode

$
0
0

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:

  1. ShowInEditForm
  2. ShowInDisplayForm
  3. ShowInNewForm

You can do this programmatically at any time, below is a link on how to do it:

http://www.sharepointdynamics.net/2011/09/how-to-hide-a-sharepoint-list-column-from-a-list-form-new-edit-and-display/

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



Viewing all articles
Browse latest Browse all 5

Trending Articles