Showing posts with label Sharepoint 2010. Show all posts
Showing posts with label Sharepoint 2010. Show all posts

Thursday, July 12, 2018

SharePoint 2010 – Unable to edit cell in Datasheet view – “This cell is read only”


When I try to edit the excel in SharePoint 2010 list in Datasheet view, I see an error saying that “The Selected Cells are Read-only” as shown the image below.


  • I have verified user Permissions to the list. User Having Full control permissions to the list
  • Checked-out by any one (It is not document library)
  • Any Attachments having read-only – NO
  • Is current column is default system column? (Like Created, Modified Etc..) – NO
After checking all these details, I found Microsoft Support article about the fix. We have Content Approval enabled in the list and that is blocking DataSheet View edit. By Turning Off the Content Approval, We can fix the error.

Here are the steps to turn off content approvals,
  • In the List select Settings
  • Select List Settings
  • Select Versioning Settings
  • In the Content Approval section select No for "Require content approval for submitted items"

Now we can able to edit the items in DataSheet view.
Hope this helps.

Friday, June 26, 2015

SharePoint User Display issue: Display name incorrect in one site collection

Recently I got an issue in my SharePoint 2013 production environment. One of the user display name not showing properly. Instead of his name, it is showing one of the employee who left the organization. By checking the user details in AD we got the details. AD team updated two emails for one user. One is his own email and other email is one of the employee who left the company. We tracked the issue and updated the profile AD and ran User Profile Sync. Everything worked well till now.

But user still having the issue in one site, his display name not showing correctly. Instead of his name, it is showing employee who left the organization. We are seeing this issue only for one site collection. Tried different approaches like deleting user permissions in the site through UI and using PowerShell commands. Nothing worked.

After Googling the issue, we got the resolution. We are seeing that issue due caching in SharePoint site collection. When I remove and add the data in SharePoint site group, SharePoint site collection user details from all users located in <Site URL>/_layouts/people.aspx?MembershipGroupId=0


To fix the issue, we need to remove the user from all users list and read it to the list. But before that we need to check all the user permissions in the site (including all the groups and individual permissions) and need to re add all the places. 

Hope this helps.

Wednesday, June 24, 2015

Copy-SPSite: Rename/Recreate SharePoint site collection

Most of my clients had a requirement to rename SharePoint site collection in all SharePoint versions including SharePoint 200, 2010 and 2013. To do that we have to take the existing site collection backup, Delete the site collection and Restore it new site collection. If anything happens in this process, we are gone. Nothing left.

But in SharePoint 2013 we got new command, Copy-SPSite command allows us to copy the site collection. This option allows us to duplicate the site collection to new site collection. We have options to specify the destination DB.

Here is the syntax for Copy-SPSite command,

Copy-SPSite Source Site URL [-DestinationDatabase Destination DB] -TargetUrl Target Site URL

We can use this command to copy the site collection in same content DB. Copy-SPSite command will not work for copy the site collection in other content databases. To do this we have to follow backup and restore process.

We can copy host named site collections using Copy-SPSite command.

Copy-SPSite -Identity Source Host Named Site collection URL -TargetUrl Destination Host Named Site collection URL -HostHeaderWebApplication Host Header web application URL

Before that we need to run Remove-SPSiteUrl command as below.


Remove-SPSiteURL -URL Host named Site collection URL

Saturday, June 20, 2015

SharePoint 2013 error – Site stuck up in Read-only mode after interrupted backup

While working with SharePoint 2013 restore and backup I got interesting error in one of my host named site collection (I hope this is generic issue, not specific to host named site collection) saying as shown the image below.



When I try to fix this issue from SharePoint central administration quotas, all the options are disabled and unable to change anything as shown the image below.


By going through some of the blogs, I got the issue. In SharePoint 2013, we are having Manintanence Mode property for SPSite makes SharePoint site is undergoing a Maintenance & is read only. We can set this SharePoint site when content DB is in read only state, or when SharePoint site upgrade, moving SharePoint site in process.
We can fix this error by clearing ClearMaintenanceMode method in SpSiteAdministration object. We can do this by running following command,
$Site = new-object Microsoft.SharePoint.Administration.SPSiteAdministration(SITE URL)  $Site.ClearMaintenanceMode()
This fixed my issue. Hope this helps.



Monday, April 27, 2015

SharePoint – Back to basics – SPLongOperation for lengthy operations

We have many hidden features in SharePoint in look and feel in Out of Box as well as custom. SPLongOperation One of the hidden feature in custom coding side. This feature exists from SharePoint but many of the users may not be aware of this. SPLongOpearation allows us to inform end users on processing screen while operating lengthy operations like moving documents from one site other, deleting sites etc... And at the end we can have options to close/ redirect the page.

Here is the sample code on usage of SPLongOperation,

               try{
                              using (SPLongOperation longOpearation = new SPLongOperation(this.Page))
                              {
                                             longOpearation.LeadingHTML = "Title of the long operation";//title message
                                             longOpearation.TrailingHTML = "this will take few sec”//sub message
                                              longOpearation.Begin();
                                             //Code start
                                             //Write the code that to be processed in long operation
                                             //code ends
                                               HttpContext context = HttpContext.Current;
                                             if (context.Request.QueryString["IsDlg"] != null)
                                             {
                                                            context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
                                                            context.Response.Flush();
                                                            context.Response.End();
                                              }
                                              else
                                              {
                                                             string url = SPContext.Current.Web.Url;
 longOpearation.End(url, SPRedirectFlags.CheckUrl, context, string.Empty);
                                             }

                              }
               }
               catch (Exception ex)
              {
                              SPUtility.TransferToErrorPage(ex.ToString());//transfores us to the error page with error message
               }

In the Begin and End methods for long operation we can have different overloaded methods. By using SPLongOperation.Begin method (String, String, SPLongOperation.BeginOperation) method we can pass title and sub message. Here in the script end method, iam passing redirection URL and checking flags and current context. For more details, here is the full description in msdn.



Sunday, April 26, 2015

SharePoint error – A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

While working on one of the existing SharePoint server, I tried to open the SharePoint central admin site. I got an error saying that “A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.” As shown the image below.



This is the error due to SQL server service got stopped. To fix the error we have to run the SQL Service as shown the image below.



But in my case, MSSQLSERVER service is started and running. Restarted the service, but it wasn’t worked for me. By digging in to the deep I got few details from system admin. The farm I am working is already had few sites. But before handing that to me all the sites deleted from SQL server. When I try to access the CA site it gives the error message.

Restarted SharePoint timer service, SQL server and all the servers in the farm. Nothing worked for me. Finally ran SharePoint configuration wizard. Super... it worked for me. Now I got the issue that some of my farm users deleted DB’s in sql server directly instead deleting form CA. By running the config wizard