Friday 26 December 2014

Set column in a list to Read only using Sharepoint Designer



Using SharePoint Designer, you can make one of the columns on your list/library Read-Only so that when a user goes to edit the list item, that one particular field will be unmodifyable, even for Full Control Permissions.
This can be done by changing the field type from an “editable” field to a simple “display” field.
To do this, open up SPD and navigate to your list.
You want to create a new “Edit” form for this list so click on the “New…” button:
new-edit-form
Type in a name for your new form. Select the “Edit Item Form” radio button and go ahead and make this the default form for editing.
read-only-columns
Click OK and then open up your new form to edit the code.
In this particular library, I have a column that I named “Read-Only” which I will be changing to read-only mode in the edit form. To do this, scroll down to the column inside the code and change the following:
 
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" 
FieldName="Read_x002d_Only" __designer:bind="{ddwrt:DataBind('u',
concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(
string(@ID)),'@Read_x002d_Only')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" 
FieldName="Read_x002d_Only" ControlMode="Edit"/>

to
 
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Display"  
FieldName="Read_x002d_Only" __designer:bind="{ddwrt:DataBind('u', 
concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims( 
string(@ID)),'@Read_x002d_Only')}"/> 
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}"  
FieldName="Read_x002d_Only" ControlMode="Display"/>

Now when you go to edit an item on your form via “Edit Properties”, the column will be read-only.





Reference:

http://sharepoint.indigoreality.com/2013/04/03/sharepoint-2010-making-a-column-read-only/

10 comments:

  1. I am inspired with your post writing style & how continuously you sharepoint training courses describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.

    ReplyDelete
  2. Such a nice blog, keep sharing with us, if you want to
    buy cushion covers online india then let us know at +91–9650270867

    ReplyDelete
  3. Nice blog, keep writing like this


    Find here online price details of companies selling Mattress Cover Cotton. Get info of suppliers, manufacturers, exporters, traders of Mattress Cover Near Me for buying in India.

    ReplyDelete
  4. https://k2incenseonlineheadshop.com/
    info@k2incenseonlineheadshop.com
    k2incenseonlineheadshop Buy liquid incense cheap Buy liquid incense cheap For Sale At The Best Incense Online Shop

    ReplyDelete
  5. https://syntheticworldwide.com/
    sales@syntheticworldwide.com

    buy cheap liquid herbal incense at your best online shop

    ReplyDelete