How to Disable Quick Edit in SharePoint?

Requirement:  Disable quick edit in SharePoint 2016 list.

How to disable quick edit in SharePoint 2013 or SharePoint 2016?
Bit background: We've a project tracking list with field "Project Health" which is updated by an event receiver based on certain parameters and business logic. So, we made the field hidden in SharePoint List forms using: How to Hide a Column from NewForm/EditForm in SharePoint?

Now the problem is: users can go to "Quick Edit" mode of the list and they get hidden field there! Although the column was hidden from Edit and New Forms, SharePoint quick edit (which replaced Datasheet view in previous versions of SharePoint) still displays the hidden field and we decided to disable quick edit mode for the SharePoint list.

SharePoint how to disable quick edit:
To disable quick edit mode in SharePoint 2013 or in SharePoint 2016, follow below steps:
  • Go to the list settings >> Click on "Advanced settings" link
  • In Advanced Settings link, Scroll down and Under "Quick property editing " option, choose "No" for "Allow items in this list to be edited using Quick Edit?" and then click OK.
    sharepoint 2013 disable quick edit powershell
  • This disables quick edit in SharePoint list.

Disable quick edit using PowerShell
Here is how we can disable quick edit SharePoint 2013 programmatically with PowerShell.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Parameters
$WebURL="http://intranet.crescent.com"
$ListName="Projects"

#Get Web and List objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists.TryGetList($ListName)

$List.DisableGridEditing=$true
$List.Update()

CSS to disable quick edit in SharePoint
Alternatively, you can hide Quick Edit button in the ribbon with CSS also. Here is the CSS to hide sharepoint quick edit:
<style>
#Ribbon\.List\.ViewFormat\.Datasheet-Large {
display:none;
}
</style>
Click on Settings Gear >> Edit Page >> Click on "Add Web Part " link and then Add script editor web part. Edit snippet and Place this CSS code in it, Stop Editing to save your changes. For Libraries, use:
<style>
#Ribbon\.Library\.ViewFormat\.Datasheet-Large {
display:none;
}
</style>
To disable Quick edit in SharePoint Online, use: How to Disable Quick Edit in SharePoint Online?

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.