Monday, December 7, 2015

Set few Fields read only in Quick Edit of a Sharepoint (2013) List view.


You can set few fields as read-only in a Quick edit / Datasheet mode of a List view through Sharepoint designer. Follow below steps to achieve it.

  1. Create a List view with all the required fields (Including Read only and editable fields) and by applying required filters 
  1. Now, open the List in sharepoint designer and edit the Newly created list view file in 'Advanced Mode'. You can do it be right clicking on the View Name in the List
  1. In the file, go to  'XMLdefinition' tag, inside that you can see 'ViewFields' section where all the fields added in step 1 are available.
  1. For all the read only fields, you add ReadOnly="TRUE" attribute in the corresponding FieldRef tag.
  1. So, a Field ref tag for a read only field would be as
      <FieldRef Name="Product" ReadOnly="TRUE"/> 
  2. Now save the file and open it in browser.
  3. Once you go to Quick Edit, you can see the read only columns are disabled.

I tested this in Sharepoint 2013 and all other functionalities like filters / sorting on read only fields work as is.

No comments:

Post a Comment