Drag & Drop Web Parts in SharePoint 2010
When I was recently creating a custom Master Page, I wanted to use CSS3 styles. Since IE 8 does not play overly well with CSS3 I built some shims to let the site degrade gracefully but I wanted the new styles to work as planned in IE 9. Easy enough right? The first thing you have to do is remove the following line from the section in your custom Master Page.
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
ie55up.js?rev=aLkCI%2BqMbk0%2BXpjAY7eBcA%3D%3D, line 2 character 37142
After a quick Google search I ran across the following two articles.
Drag and drop webpart manager not saving changes
Corners in IE and Firefox for SharePoint Master Pages
Obviously there are known issues that SharePoint 2010 is not fully compatible with IE 9, and this is just another example. But you know the coder in me wanted to know why this wasn’t working and if it could be quickly fixed. Running a few quick traces I found that the primary functions used to allow web parts to be moved are found in ie55up.js with a few helper functions in core.js. These are found in the 14 hive under 14TEMPLATELAYOUTS1033 in case you wish to check them out yourself.
In case you would like to give this a try, you will want to review and likely update the following functions.
Suggested Work Arounds
My first suggestion, and what worked for us, is that we ignored the fact web part drag and drop did not work. First, it only works in IE anyhow. Second, you can always Close a web part, then add the closed web part from the Closed Web Parts Category to the correct web part zone. If you need to reorder web parts in a web part zone you can use this same technique. Sure, it’s not ideal, but beats trying to fix core SharePoint functionality for modern browsers.
Use IE Developer Tool Bar
A simple work around when you are editing your site would be to use the IE Developer Tool bar to set your Document Mode to Internet Explorer 8 Standards.
Set the Document mode to Internet Explorer 8 Standards. Then moved the web part and the new web part zone acknowledges the web part and no errors are thrown.
Dropped Web part into new Web Part Zone. Was successfully accepted.
It’s an interesting hack, but it works.
Have you found another solution? Did you override the web part drag and drop functionality successfully? If so please tell me as I would like to help you share it with the community.